[PATCH v3 2/4] media: i2c: vd55g1: Fix return code in vd55g1_enable_streams error path

Benjamin Mugnier posted 4 patches 4 months ago
[PATCH v3 2/4] media: i2c: vd55g1: Fix return code in vd55g1_enable_streams error path
Posted by Benjamin Mugnier 4 months ago
Enable stream was returning success even if an error occurred, fix it by
modifying the err_rpm_put return value to -EINVAL.

Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
---
 drivers/media/i2c/vd55g1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/vd55g1.c b/drivers/media/i2c/vd55g1.c
index 78dd22d9cab03edf4ff3e5a301f8d045e930c997..336dc3c85ac9e695f22aa524e0df6138dc76e45c 100644
--- a/drivers/media/i2c/vd55g1.c
+++ b/drivers/media/i2c/vd55g1.c
@@ -1084,7 +1084,7 @@ static int vd55g1_enable_streams(struct v4l2_subdev *sd,
 
 err_rpm_put:
 	pm_runtime_put(sensor->dev);
-	return 0;
+	return -EINVAL;
 }
 
 static int vd55g1_disable_streams(struct v4l2_subdev *sd,

-- 
2.25.1
Re: [PATCH v3 2/4] media: i2c: vd55g1: Fix return code in vd55g1_enable_streams error path
Posted by Sakari Ailus 4 months ago
Hi Benjamin,

On Wed, Jun 11, 2025 at 10:48:31AM +0200, Benjamin Mugnier wrote:
> Enable stream was returning success even if an error occurred, fix it by
> modifying the err_rpm_put return value to -EINVAL.
> 
> Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>

This looks like something that should be backported btw. What's the Fixes:
header? I can add that while applying.

-- 
Regards,

Sakari Ailus
Re: [PATCH v3 2/4] media: i2c: vd55g1: Fix return code in vd55g1_enable_streams error path
Posted by Benjamin Mugnier 4 months ago
On 6/12/25 08:24, Sakari Ailus wrote:
> Hi Benjamin,
> 
> On Wed, Jun 11, 2025 at 10:48:31AM +0200, Benjamin Mugnier wrote:
>> Enable stream was returning success even if an error occurred, fix it by
>> modifying the err_rpm_put return value to -EINVAL.
>>
>> Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
> 
> This looks like something that should be backported btw. What's the Fixes:
> header? I can add that while applying.
> 

You're correct, here it is :

Fixes: e56616d7b23c ("media: i2c: Add driver for ST VD55G1 camera sensor")

Thank you.

-- 
Regards,
Benjamin