Skip to content

Commit

Permalink
[media] dvb-usb: improve sanity check of adap->active_fe in dvb_usb_c…
Browse files Browse the repository at this point in the history
…trl_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>
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Sep 9, 2011
1 parent 4b5d01e commit 2d04c13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2d04c13

Please sign in to comment.