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:
Hans Verkuil 2026-05-12 08:46:15 +02:00
parent bbba3e260a
commit 813dacdda8

View File

@ -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;