MLK-11291 radio-si476x: initialize local variable rangelow and rangehigh before using...
authorZidan Wang <zidan.wang@freescale.com>
Tue, 28 Jul 2015 01:48:43 +0000 (09:48 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:48:14 +0000 (14:48 -0500)
When transfer rangelow and rangehigh from user space, the local variable
rangelow and rangehigh will not be initialized before using them.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit c326f56005f0ee3d0c1fd6ebdebabda919c278dd)

drivers/media/radio/radio-si476x.c

index 271f725..cb7fcfb 100644 (file)
@@ -775,7 +775,8 @@ static int si476x_radio_s_hw_freq_seek(struct file *file, void *priv,
                        rangelow = si476x_to_v4l2(radio->core, rangelow);
                else
                        goto unlock;
-       }
+       } else
+               rangelow = seek->rangelow;
        if (!seek->rangehigh) {
                err = regmap_read(radio->core->regmap,
                                  SI476X_PROP_SEEK_BAND_TOP,
@@ -784,7 +785,8 @@ static int si476x_radio_s_hw_freq_seek(struct file *file, void *priv,
                        rangehigh = si476x_to_v4l2(radio->core, rangehigh);
                else
                        goto unlock;
-       }
+       } else
+               rangehigh = seek->rangehigh;
 
        if (rangelow > rangehigh) {
                err = -EINVAL;