[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250113101914.2441210-1-mordan@ispras.ru>
Date: Mon, 13 Jan 2025 13:19:14 +0300
From: Vitalii Mordan <mordan@...ras.ru>
To: Jacopo Mondi <jacopo@...ndi.org>
Cc: Vitalii Mordan <mordan@...ras.ru>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Kuninori Morimoto <morimoto.kuninori@...esas.com>,
Guennadi Liakhovetski <g.liakhovetski@....de>,
linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org,
Fedor Pchelkin <pchelkin@...ras.ru>,
Alexey Khoroshilov <khoroshilov@...ras.ru>,
Vadim Mutilin <mutilin@...ras.ru>,
stable@...r.kernel.org
Subject: [PATCH] media: mt9t112: fix error handling in mt9t112_camera_probe
The macro mt9t112_reg_read returns from mt9t112_camera_probe() in case of
an error. However, a call to the shutdown function mt9t112_s_power() is
required at this point. Failure to execute the shutdown function will
result in the priv->clk not being properly disabled.
Found by Linux Verification Center (linuxtesting.org) with Klever.
Fixes: 858424b998ae ("V4L/DVB (13670): soc-camera: Add mt9t112 camera driver")
Cc: stable@...r.kernel.org
Signed-off-by: Vitalii Mordan <mordan@...ras.ru>
---
drivers/media/i2c/mt9t112.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/media/i2c/mt9t112.c b/drivers/media/i2c/mt9t112.c
index 878dff9b7577..82e2c42f4c7b 100644
--- a/drivers/media/i2c/mt9t112.c
+++ b/drivers/media/i2c/mt9t112.c
@@ -1034,7 +1034,11 @@ static int mt9t112_camera_probe(struct i2c_client *client)
return ret;
/* Check and show chip ID. */
- mt9t112_reg_read(chipid, client, 0x0000);
+ chipid = __mt9t112_reg_read(client, 0x0000);
+ if (chipid < 0) {
+ ret = chipid;
+ goto done;
+ }
switch (chipid) {
case 0x2680:
--
2.25.1
Powered by blists - more mailing lists