From: Zidan Wang Date: Tue, 28 Jul 2015 01:48:43 +0000 (+0800) Subject: MLK-11291 radio-si476x: initialize local variable rangelow and rangehigh before using... X-Git-Tag: C0P2-H0.0--20200415~4430 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=1f78c74db826f81cf636df50f7ad71e1fc5ea402;p=linux.git MLK-11291 radio-si476x: initialize local variable rangelow and rangehigh before using them 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 (cherry picked from commit c326f56005f0ee3d0c1fd6ebdebabda919c278dd) --- diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c index 271f725b17e8..cb7fcfb36c85 100644 --- a/drivers/media/radio/radio-si476x.c +++ b/drivers/media/radio/radio-si476x.c @@ -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;