Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH] media: visl: check if ctx->tpg_str_buf allocation failed
@ 2026-05-12  6:46 Hans Verkuil
  0 siblings, 0 replies; only message in thread
From: Hans Verkuil @ 2026-05-12  6:46 UTC (permalink / raw)
  To: Linux Media Mailing List

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>
---
diff --git a/drivers/media/test-drivers/visl/visl-core.c b/drivers/media/test-drivers/visl/visl-core.c
index 127ab18bce99..5e9bdd425d4a 100644
--- a/drivers/media/test-drivers/visl/visl-core.c
+++ b/drivers/media/test-drivers/visl/visl-core.c
@@ -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;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-12  6:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12  6:46 [PATCH] media: visl: check if ctx->tpg_str_buf allocation failed Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox