mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 18:21:24 +02:00
media: visl: check if ctx->tpg_str_buf allocation failed
The result of ctx->tpg_str_buf = kzalloc(TPG_STR_BUF_SZ, GFP_KERNEL); was never checked. Add this. Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
bbba3e260a
commit
813dacdda8
|
|
@ -339,6 +339,10 @@ static int visl_open(struct file *file)
|
|||
}
|
||||
|
||||
ctx->tpg_str_buf = kzalloc(TPG_STR_BUF_SZ, GFP_KERNEL);
|
||||
if (!ctx->tpg_str_buf) {
|
||||
rc = -ENOMEM;
|
||||
goto free_ctx;
|
||||
}
|
||||
|
||||
v4l2_fh_init(&ctx->fh, video_devdata(file));
|
||||
ctx->dev = dev;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user