Skip to content

Commit

Permalink
[media] dvb_usb_v2: do not try to remove non-existent adapter
Browse files Browse the repository at this point in the history
Check that adapter exists before trying to remove it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Aug 4, 2012
1 parent d10d1b9 commit b62fd17
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/media/dvb/dvb-usb/dvb_usb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,9 +717,11 @@ static int dvb_usbv2_adapter_exit(struct dvb_usb_device *d)
dev_dbg(&d->udev->dev, "%s:\n", __func__);

for (i = MAX_NO_OF_ADAPTER_PER_DEVICE - 1; i >= 0; i--) {
dvb_usbv2_adapter_frontend_exit(&d->adapter[i]);
dvb_usbv2_adapter_dvb_exit(&d->adapter[i]);
dvb_usbv2_adapter_stream_exit(&d->adapter[i]);
if (d->adapter[i].props) {
dvb_usbv2_adapter_frontend_exit(&d->adapter[i]);
dvb_usbv2_adapter_dvb_exit(&d->adapter[i]);
dvb_usbv2_adapter_stream_exit(&d->adapter[i]);
}
}

return 0;
Expand Down

0 comments on commit b62fd17

Please sign in to comment.