[media] vivid-radio-rx: Don't go past buffer

drivers/media/platform/vivid/vivid-radio-rx.c:198 vivid_radio_rx_s_hw_freq_seek() error: buffer overflow 'vivid_radio_bands' 3 <= 3

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Mauro Carvalho Chehab 2015-04-28 20:00:55 -03:00
parent 094af36a3a
commit 322583c410
1 changed files with 2 additions and 0 deletions

View File

@ -195,6 +195,8 @@ int vivid_radio_rx_s_hw_freq_seek(struct file *file, void *fh, const struct v4l2
if (dev->radio_rx_freq >= vivid_radio_bands[band].rangelow && if (dev->radio_rx_freq >= vivid_radio_bands[band].rangelow &&
dev->radio_rx_freq <= vivid_radio_bands[band].rangehigh) dev->radio_rx_freq <= vivid_radio_bands[band].rangehigh)
break; break;
if (band == TOT_BANDS)
return -EINVAL;
low = vivid_radio_bands[band].rangelow; low = vivid_radio_bands[band].rangelow;
high = vivid_radio_bands[band].rangehigh; high = vivid_radio_bands[band].rangehigh;
} }