diff mbox series

media: i2c: mt9m114: Fix missing error unwind in probe()

Message ID 20231003192043.27690-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit ab75641ffd3a6a69ad5552a4cba2a20ff67e0904
Headers show
Series media: i2c: mt9m114: Fix missing error unwind in probe() | expand

Commit Message

Laurent Pinchart Oct. 3, 2023, 7:20 p.m. UTC
Two paths in the probe function return directly instead of jumping to
error handling. Fix them.

Fixes: 23579d2f69cc ("media: i2c: Add driver for onsemi MT9M114 camera sensor")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
This patch applies on top of "[PATCH v4 2/2] media: i2c: Add driver for
onsemi MT9M114 camera sensor", which is already included in the "[GIT
PULL FOR 6.7] Camera sensor patches, preparation for enabling streams
API" pull request for v6.7. It targets the same kernel release.

The Fixes tag depends on that pull request being pulled instead of
cherry-picked, and the media tree not being rebased.
---
 drivers/media/i2c/mt9m114.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c
index dae675e52390..ac19078ceda3 100644
--- a/drivers/media/i2c/mt9m114.c
+++ b/drivers/media/i2c/mt9m114.c
@@ -2367,7 +2367,7 @@  static int mt9m114_probe(struct i2c_client *client)
 
 	ret = mt9m114_clk_init(sensor);
 	if (ret)
-		return ret;
+		goto error_ep_free;
 
 	/*
 	 * Identify the sensor. The driver supports runtime PM, but needs to
@@ -2378,7 +2378,7 @@  static int mt9m114_probe(struct i2c_client *client)
 	ret = mt9m114_power_on(sensor);
 	if (ret < 0) {
 		dev_err_probe(dev, ret, "Could not power on the device\n");
-		return ret;
+		goto error_ep_free;
 	}
 
 	ret = mt9m114_identify(sensor);