diff options
author | Michael Krufky <mkrufky@kernellabs.com> | 2011-09-08 01:17:39 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-09-09 15:28:04 -0300 |
commit | 2d04c13a507f5a01daa7422cd52250809573cfdb (patch) | |
tree | 965333495268c26193ee6f10a6b979ebe726d9a4 /drivers | |
parent | 4b5d01e9f66446be0c2beebfab0463210bed315d (diff) | |
download | lwn-2d04c13a507f5a01daa7422cd52250809573cfdb.tar.gz lwn-2d04c13a507f5a01daa7422cd52250809573cfdb.zip |
[media] dvb-usb: improve sanity check of adap->active_fe in dvb_usb_ctrl_feed
The check for (adap->active_fe < 0) at the top of dvb_usb_ctrl_feed is a sanity
check to ensure that adap->active_fe is valid. Improve that sanity check
by also checking for (adap->active_fe >= adap->num_frontends_initialized)
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-dvb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c index 460b5ae1a45d..038679bd4956 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c @@ -17,7 +17,8 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) if (adap == NULL) return -ENODEV; - if (adap->active_fe < 0) { + if ((adap->active_fe < 0) || + (adap->active_fe >= adap->num_frontends_initialized)) { return -EINVAL; } |