diff mbox series

[04/11] media: sun6i-csi: add a missing return code

Message ID 525bad50008338d96fb71e724675061ffa07ff87.1623846327.git.mchehab+huawei@kernel.org
State Accepted
Commit ba9139116bc053897e6fb16a51c463604c4da371
Headers show
Series Address some smatch warnings | expand

Commit Message

Mauro Carvalho Chehab June 16, 2021, 12:28 p.m. UTC
As pointed by smatch, there's a missing return code:

	drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c:485 sun6i_video_open() warn: missing error code 'ret'

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

yong June 17, 2021, 5:37 a.m. UTC | #1
Hi,

It does not mean there is a error. As the comment, it just check if the
csi is powered.

On Wed, 16 Jun 2021 14:28:30 +0200
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> wrote:

> As pointed by smatch, there's a missing return code:

> 

> 	drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c:485

> sun6i_video_open() warn: missing error code 'ret'

> 

> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

> ---

>  drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c | 4 +++-

>  1 file changed, 3 insertions(+), 1 deletion(-)

> 

> diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c

> b/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c index

> 3181d0781b61..07b2161392d2 100644 ---

> a/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c +++

> b/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c @@ -481,8

> +481,10 @@ static int sun6i_video_open(struct file *file) goto

> fh_release; 

>  	/* check if already powered */

> -	if (!v4l2_fh_is_singular_file(file))

> +	if (!v4l2_fh_is_singular_file(file)) {

> +		ret = -EBUSY;

>  		goto unlock;

> +	}

>  

>  	ret = sun6i_csi_set_power(video->csi, true);

>  	if (ret < 0)


Thanks
diff mbox series

Patch

diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c
index 3181d0781b61..07b2161392d2 100644
--- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c
+++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c
@@ -481,8 +481,10 @@  static int sun6i_video_open(struct file *file)
 		goto fh_release;
 
 	/* check if already powered */
-	if (!v4l2_fh_is_singular_file(file))
+	if (!v4l2_fh_is_singular_file(file)) {
+		ret = -EBUSY;
 		goto unlock;
+	}
 
 	ret = sun6i_csi_set_power(video->csi, true);
 	if (ret < 0)