diff mbox series

media: ov13b10: Fix some error checking in probe

Message ID b7ed2497-35d6-490e-b2a6-089f8099290a@moroto.mountain (mailing list archive)
State New, archived
Headers show
Series media: ov13b10: Fix some error checking in probe | expand

Commit Message

Dan Carpenter July 19, 2023, 10:16 a.m. UTC
The "ret = " assignment was missing, so ov13b10_power_on() is not
checked for errors.  Add the assignment.

Fixes: 6e28afd15228 ("media: ov13b10: add PM control support based on power resources")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
Adding error handling always risky breaking the driver and I have not
tested this patch.

 drivers/media/i2c/ov13b10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bingbu Cao July 20, 2023, 4:33 a.m. UTC | #1
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>

Thanks!

------------------------------------------------------------------------
BRs,  
Bingbu Cao 

>-----Original Message-----
>From: Dan Carpenter <dan.carpenter@linaro.org>
>Sent: Wednesday, July 19, 2023 6:16 PM
>To: Cao, Bingbu <bingbu.cao@intel.com>
>Cc: Kao, Arec <arec.kao@intel.com>; Sakari Ailus
><sakari.ailus@linux.intel.com>; Mauro Carvalho Chehab <mchehab@kernel.org>;
>Hans de Goede <hdegoede@redhat.com>; Yao, Hao <hao.yao@intel.com>; linux-
>media@vger.kernel.org; kernel-janitors@vger.kernel.org
>Subject: [PATCH] media: ov13b10: Fix some error checking in probe
>
>The "ret = " assignment was missing, so ov13b10_power_on() is not checked
>for errors.  Add the assignment.
>
>Fixes: 6e28afd15228 ("media: ov13b10: add PM control support based on power
>resources")
>Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
>---
>Adding error handling always risky breaking the driver and I have not
>tested this patch.
>
> drivers/media/i2c/ov13b10.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/media/i2c/ov13b10.c b/drivers/media/i2c/ov13b10.c
>index dbc642c5995b..8ebdb32dd3db 100644
>--- a/drivers/media/i2c/ov13b10.c
>+++ b/drivers/media/i2c/ov13b10.c
>@@ -1501,7 +1501,7 @@ static int ov13b10_probe(struct i2c_client *client)
>
> 	full_power = acpi_dev_state_d0(&client->dev);
> 	if (full_power) {
>-		ov13b10_power_on(&client->dev);
>+		ret = ov13b10_power_on(&client->dev);
> 		if (ret) {
> 			dev_err(&client->dev, "failed to power on\n");
> 			return ret;
>--
>2.39.2
diff mbox series

Patch

diff --git a/drivers/media/i2c/ov13b10.c b/drivers/media/i2c/ov13b10.c
index dbc642c5995b..8ebdb32dd3db 100644
--- a/drivers/media/i2c/ov13b10.c
+++ b/drivers/media/i2c/ov13b10.c
@@ -1501,7 +1501,7 @@  static int ov13b10_probe(struct i2c_client *client)
 
 	full_power = acpi_dev_state_d0(&client->dev);
 	if (full_power) {
-		ov13b10_power_on(&client->dev);
+		ret = ov13b10_power_on(&client->dev);
 		if (ret) {
 			dev_err(&client->dev, "failed to power on\n");
 			return ret;