All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: v4l: async: fix return of unitialized variable ret
@ 2017-11-03  6:58 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-11-03  6:58 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Hans Verkuil,
	Niklas Söderlund, Sebastian Reichel, linux-media
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

A shadow declaration of variable ret is being assigned a return error
status and this value is being lost when the error exit goto's jump
out of the local scope. This leads to an uninitalized error return value
in the outer scope being returned. Fix this by removing the inner scoped
declaration of variable ret.

Detected by CoverityScan, CID#1460380 ("Uninitialized scalar variable")

Fixes: fb45f436b818 ("media: v4l: async: Fix notifier complete callback error handling")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/media/v4l2-core/v4l2-async.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index 49f7eccc76db..7020b2e6d158 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -550,7 +550,6 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd)
 		struct v4l2_device *v4l2_dev =
 			v4l2_async_notifier_find_v4l2_dev(notifier);
 		struct v4l2_async_subdev *asd;
-		int ret;
 
 		if (!v4l2_dev)
 			continue;
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] media: v4l: async: fix return of unitialized variable ret
@ 2017-11-03  6:58 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-11-03  6:58 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Hans Verkuil,
	Niklas Söderlund, Sebastian Reichel, linux-media
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

A shadow declaration of variable ret is being assigned a return error
status and this value is being lost when the error exit goto's jump
out of the local scope. This leads to an uninitalized error return value
in the outer scope being returned. Fix this by removing the inner scoped
declaration of variable ret.

Detected by CoverityScan, CID#1460380 ("Uninitialized scalar variable")

Fixes: fb45f436b818 ("media: v4l: async: Fix notifier complete callback error handling")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/media/v4l2-core/v4l2-async.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index 49f7eccc76db..7020b2e6d158 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -550,7 +550,6 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd)
 		struct v4l2_device *v4l2_dev  			v4l2_async_notifier_find_v4l2_dev(notifier);
 		struct v4l2_async_subdev *asd;
-		int ret;
 
 		if (!v4l2_dev)
 			continue;
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: v4l: async: fix return of unitialized variable ret
  2017-11-03  6:58 ` Colin King
@ 2017-11-03  7:37   ` Niklas Söderlund
  -1 siblings, 0 replies; 4+ messages in thread
From: Niklas Söderlund @ 2017-11-03  7:37 UTC (permalink / raw)
  To: Colin King
  Cc: Mauro Carvalho Chehab, Sakari Ailus, Hans Verkuil,
	Sebastian Reichel, linux-media, kernel-janitors, linux-kernel

Hi Colin,

Thanks for your patch.

On 2017-11-03 06:58:27 +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> A shadow declaration of variable ret is being assigned a return error
> status and this value is being lost when the error exit goto's jump
> out of the local scope. This leads to an uninitalized error return value
> in the outer scope being returned. Fix this by removing the inner scoped
> declaration of variable ret.
> 
> Detected by CoverityScan, CID#1460380 ("Uninitialized scalar variable")
> 
> Fixes: fb45f436b818 ("media: v4l: async: Fix notifier complete callback error handling")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  drivers/media/v4l2-core/v4l2-async.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
> index 49f7eccc76db..7020b2e6d158 100644
> --- a/drivers/media/v4l2-core/v4l2-async.c
> +++ b/drivers/media/v4l2-core/v4l2-async.c
> @@ -550,7 +550,6 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd)
>  		struct v4l2_device *v4l2_dev =
>  			v4l2_async_notifier_find_v4l2_dev(notifier);
>  		struct v4l2_async_subdev *asd;
> -		int ret;
>  
>  		if (!v4l2_dev)
>  			continue;
> -- 
> 2.14.1
> 

-- 
Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: v4l: async: fix return of unitialized variable ret
@ 2017-11-03  7:37   ` Niklas Söderlund
  0 siblings, 0 replies; 4+ messages in thread
From: Niklas Söderlund @ 2017-11-03  7:37 UTC (permalink / raw)
  To: Colin King
  Cc: Mauro Carvalho Chehab, Sakari Ailus, Hans Verkuil,
	Sebastian Reichel, linux-media, kernel-janitors, linux-kernel

Hi Colin,

Thanks for your patch.

On 2017-11-03 06:58:27 +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> A shadow declaration of variable ret is being assigned a return error
> status and this value is being lost when the error exit goto's jump
> out of the local scope. This leads to an uninitalized error return value
> in the outer scope being returned. Fix this by removing the inner scoped
> declaration of variable ret.
> 
> Detected by CoverityScan, CID#1460380 ("Uninitialized scalar variable")
> 
> Fixes: fb45f436b818 ("media: v4l: async: Fix notifier complete callback error handling")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  drivers/media/v4l2-core/v4l2-async.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
> index 49f7eccc76db..7020b2e6d158 100644
> --- a/drivers/media/v4l2-core/v4l2-async.c
> +++ b/drivers/media/v4l2-core/v4l2-async.c
> @@ -550,7 +550,6 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd)
>  		struct v4l2_device *v4l2_dev >  			v4l2_async_notifier_find_v4l2_dev(notifier);
>  		struct v4l2_async_subdev *asd;
> -		int ret;
>  
>  		if (!v4l2_dev)
>  			continue;
> -- 
> 2.14.1
> 

-- 
Regards,
Niklas Söderlund
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-03  7:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-03  6:58 [PATCH] media: v4l: async: fix return of unitialized variable ret Colin King
2017-11-03  6:58 ` Colin King
2017-11-03  7:37 ` Niklas Söderlund
2017-11-03  7:37   ` Niklas Söderlund

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.