[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <95b98539-0db4-c877-35af-fd82dd78a8c1@kernel.org>
Date: Thu, 20 Jul 2017 17:28:25 -0600
From: Shuah Khan <shuah@...nel.org>
To: Colin King <colin.king@...onical.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Max Kellermann <max.kellermann@...il.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Markus Elfring <elfring@...rs.sourceforge.net>,
Ingo Molnar <mingo@...nel.org>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
linux-media@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org,
Shuah Khan <shuahkh@....samsung.com>,
Shuah Khan <shuah@...nel.org>
Subject: Re: [PATCH][V2] dvb_frontend: ensure that inital front end status
initialized
On 07/20/2017 04:12 PM, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
>
> The fe_status variable s is not initialized meaning it can have any
> random garbage status. This could be problematic if fe->ops.tune is
> false as s is not updated by the call to fe->ops.tune() and a
> subsequent check on the change status will using a garbage value.
> Fix this by adding FE_NONE to the enum fe_status and initializing
> s to this.
>
> Detected by CoverityScan, CID#112887 ("Uninitialized scalar variable")
>
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
Reviewed-by: Shuah Khan <shuahkh@....samsung.com>
Looks good to me. Do you mind fixing dvb_frontend_swzigzag() as well.
It currently initializes enum fe_status s = 0; in a separate patch.
> ---
> drivers/media/dvb-core/dvb_frontend.c | 2 +-
> include/uapi/linux/dvb/frontend.h | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
> index e3fff8f64d37..18cc3bbc699c 100644
> --- a/drivers/media/dvb-core/dvb_frontend.c
> +++ b/drivers/media/dvb-core/dvb_frontend.c
> @@ -631,7 +631,7 @@ static int dvb_frontend_thread(void *data)
> struct dvb_frontend *fe = data;
> struct dtv_frontend_properties *c = &fe->dtv_property_cache;
> struct dvb_frontend_private *fepriv = fe->frontend_priv;
> - enum fe_status s;
> + enum fe_status s = FE_NONE;
> enum dvbfe_algo algo;
> bool re_tune = false;
> bool semheld = false;
> diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h
> index 00a20cd21ee2..afc3972b0879 100644
> --- a/include/uapi/linux/dvb/frontend.h
> +++ b/include/uapi/linux/dvb/frontend.h
> @@ -127,6 +127,7 @@ enum fe_sec_mini_cmd {
> * to reset DiSEqC, tone and parameters
> */
> enum fe_status {
> + FE_NONE = 0x00,
> FE_HAS_SIGNAL = 0x01,
> FE_HAS_CARRIER = 0x02,
> FE_HAS_VITERBI = 0x04,
>
Powered by blists - more mailing lists