From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: Colin King <colin.king@canonical.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Hans Verkuil <hans.verkuil@cisco.com>,
Sebastian Reichel <sre@kernel.org>,
linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: v4l: async: fix return of unitialized variable ret
Date: Fri, 3 Nov 2017 08:37:09 +0100 [thread overview]
Message-ID: <20171103073709.GD24132@bigcity.dyn.berto.se> (raw)
In-Reply-To: <20171103065827.25988-1-colin.king@canonical.com>
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
prev parent reply other threads:[~2017-11-03 7:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-03 6:58 [PATCH] media: v4l: async: fix return of unitialized variable ret Colin King
2017-11-03 7:37 ` Niklas Söderlund [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171103073709.GD24132@bigcity.dyn.berto.se \
--to=niklas.soderlund@ragnatech.se \
--cc=colin.king@canonical.com \
--cc=hans.verkuil@cisco.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).