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>
if (adap == NULL)
return -ENODEV;
- if (adap->active_fe < 0) {
+ if ((adap->active_fe < 0) ||
+ (adap->active_fe >= adap->num_frontends_initialized)) {
return -EINVAL;
}