From: Antti Palosaari Date: Wed, 27 Jun 2012 01:49:19 +0000 (-0300) Subject: [media] dvb_usb_v2: do not try to remove non-existent adapter X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b62fd172ff1da93a0c720639e1f64f2a4282f943;p=openwrt%2Fstaging%2Fblogic.git [media] dvb_usb_v2: do not try to remove non-existent adapter Check that adapter exists before trying to remove it. Signed-off-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_core.c b/drivers/media/dvb/dvb-usb/dvb_usb_core.c index 920542c0b672..aed7463167bc 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb_core.c +++ b/drivers/media/dvb/dvb-usb/dvb_usb_core.c @@ -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;