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>
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;