Skip to content

Commit

Permalink
[media] dvb_usb_v2: try to remove all adapters on exit
Browse files Browse the repository at this point in the history
It did not removed adapter on error case as .num_adapters_initialized
was set after success adapter initialization. It should be safe to
try remove all possible adapters in any-case.

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 ffe4ac9 commit 6e3a5da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/dvb/dvb-usb/dvb_usb_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ static int dvb_usbv2_adapter_exit(struct dvb_usb_device *d)
{
int i;

for (i = d->num_adapters_initialized - 1; i >= 0; i--) {
pr_debug("%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]);
Expand Down

0 comments on commit 6e3a5da

Please sign in to comment.