diff options
author | Antti Palosaari <crope@iki.fi> | 2012-06-26 21:49:19 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-04 06:56:39 -0400 |
commit | b62fd172ff1da93a0c720639e1f64f2a4282f943 (patch) | |
tree | 7dadd876340ba9855248ed8dec308d6629d7ca88 /drivers/media/dvb | |
parent | d10d1b9ac97b96dd9183944d30b1664bdbb5fbf6 (diff) |
[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 <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb_usb_core.c | 8 |
1 files changed, 5 insertions, 3 deletions
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) | |||
717 | dev_dbg(&d->udev->dev, "%s:\n", __func__); | 717 | dev_dbg(&d->udev->dev, "%s:\n", __func__); |
718 | 718 | ||
719 | for (i = MAX_NO_OF_ADAPTER_PER_DEVICE - 1; i >= 0; i--) { | 719 | for (i = MAX_NO_OF_ADAPTER_PER_DEVICE - 1; i >= 0; i--) { |
720 | dvb_usbv2_adapter_frontend_exit(&d->adapter[i]); | 720 | if (d->adapter[i].props) { |
721 | dvb_usbv2_adapter_dvb_exit(&d->adapter[i]); | 721 | dvb_usbv2_adapter_frontend_exit(&d->adapter[i]); |
722 | dvb_usbv2_adapter_stream_exit(&d->adapter[i]); | 722 | dvb_usbv2_adapter_dvb_exit(&d->adapter[i]); |
723 | dvb_usbv2_adapter_stream_exit(&d->adapter[i]); | ||
724 | } | ||
723 | } | 725 | } |
724 | 726 | ||
725 | return 0; | 727 | return 0; |