lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tencent_1CC2EFA6BE166A2B0ACCD54358210D955B05@qq.com>
Date: Sun, 22 Jun 2025 22:19:36 +0800
From: Zhang Shurong <zhang_shurong@...mail.com>
To: jacopo@...ndi.org
Cc: mchehab@...nel.org,
	u.kleine-koenig@...gutronix.de,
	hverkuil@...all.nl,
	linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Zhang Shurong <zhang_shurong@...mail.com>
Subject: [PATCH] media: rj54n1cb0c: Fix memleak in rj54n1_probe()

rj54n1_probe() won't clean all the allocated resources in fail
path, which may causes the memleaks. Add v4l2_ctrl_handler_free() to
prevent memleak.

Fixes: f187352dcd45 ("media: i2c: Copy rj54n1cb0c soc_camera sensor driver")
Signed-off-by: Zhang Shurong <zhang_shurong@...mail.com>
---
 drivers/media/i2c/rj54n1cb0c.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/i2c/rj54n1cb0c.c b/drivers/media/i2c/rj54n1cb0c.c
index b7ca39f63dba..b788c7cec5f9 100644
--- a/drivers/media/i2c/rj54n1cb0c.c
+++ b/drivers/media/i2c/rj54n1cb0c.c
@@ -1331,6 +1331,7 @@ static int rj54n1_probe(struct i2c_client *client)
 			V4L2_CID_AUTO_WHITE_BALANCE, 0, 1, 1, 1);
 	rj54n1->subdev.ctrl_handler = &rj54n1->hdl;
 	if (rj54n1->hdl.error)
+		v4l2_ctrl_handler_free(&rj54n1->hdl);
 		return rj54n1->hdl.error;
 
 	rj54n1->clk_div		= clk_div;
-- 
2.30.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ