• M
    media: radio-si476x: fix behavior when seek->range* are defined · 02d73243
    Mauro Carvalho Chehab 提交于
    The logic at si476x_radio_s_hw_freq_seek() checks if the
    frequency range that will be used to handle hardware seek
    has the minimal frequency under rangelow. That works fine
    if userspace zeros both fields. However, if userspace
    fills either seek->rangelow or seek-rangehigh, it won't
    read the corresponding range from the device, causing the
    values to be unitialized, as warned by smatch:
    
    	drivers/media/radio/radio-si476x.c:789 si476x_radio_s_hw_freq_seek() error: uninitialized symbol 'rangelow'.
    	drivers/media/radio/radio-si476x.c:789 si476x_radio_s_hw_freq_seek() error: uninitialized symbol 'rangehigh'.
    
    Fix it by initializing those vars from the values present at
    the struct v4l2_hw_freq_seek.
    
    While here, simplify the logic which reads such values from
    the hardware limits.
    Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
    02d73243
radio-si476x.c 40.3 KB