]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
media: dvb_frontend: ensure that inital front end status initialized
authorColin Ian King <colin.king@canonical.com>
Thu, 20 Jul 2017 22:12:07 +0000 (18:12 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sun, 27 Aug 2017 21:55:51 +0000 (17:55 -0400)
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@canonical.com>
Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/dvb-core/dvb_frontend.c
include/uapi/linux/dvb/frontend.h

index e3fff8f64d37d850cb6bde5becb22e86a633cbef..18cc3bbc699c021c2884ff4376c00df532898704 100644 (file)
@@ -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;
index 00a20cd21ee230dabd55954d58209d1e59025d24..afc3972b08795d33b965efe33b7d7067e9c012a6 100644 (file)
@@ -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,