[media] ite-cir: initialize use_demodulator before using it
authorNicolas Iooss <nicolas.iooss_linux@m4x.org>
Sat, 10 Sep 2016 16:59:49 +0000 (13:59 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 24 Oct 2016 19:19:28 +0000 (17:19 -0200)
Function ite_set_carrier_params() uses variable use_demodulator after
having initialized it to false in some if branches, but this variable is
never set to true otherwise.

This bug has been found using clang -Wsometimes-uninitialized warning
flag.

Fixes: 620a32bba4a2 ("[media] rc: New rc-based ite-cir driver for
several ITE CIRs")

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/rc/ite-cir.c

index c5e8e3885766528c8ea9f8b53f60961c86f8cb1e..367b28bed627f69025adc554afc830fc20ac72aa 100644 (file)
@@ -261,6 +261,8 @@ static void ite_set_carrier_params(struct ite_dev *dev)
 
                        if (allowance > ITE_RXDCR_MAX)
                                allowance = ITE_RXDCR_MAX;
+
+                       use_demodulator = true;
                }
        }