summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-12-29 16:45:21 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 12:19:26 -0200
commit33c6853347c13b7cf8d11c12714cd855a84bc992 (patch)
tree5e6256d53617be98004e29f0afbd8a9852217a3f /drivers/media
parent0230d60e4661d9ced6fb0b9a30f182ebdafbba7a (diff)
downloadlinux-stable-33c6853347c13b7cf8d11c12714cd855a84bc992.tar.gz
linux-stable-33c6853347c13b7cf8d11c12714cd855a84bc992.tar.bz2
linux-stable-33c6853347c13b7cf8d11c12714cd855a84bc992.zip
[media] dvb-usb-v2: postpone removal of media_device
We should not remove the media_device until its last usage, or we may have use after free troubles. So, move the per-adapter media_device removal to happen at the end of the adapter removal code. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/dvb-usb-v2/dvb_usb_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
index e8491f73c0d9..f0565bf3673e 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
@@ -542,7 +542,6 @@ static int dvb_usbv2_adapter_dvb_exit(struct dvb_usb_adapter *adap)
adap->demux.dmx.close(&adap->demux.dmx);
dvb_dmxdev_release(&adap->dmxdev);
dvb_dmx_release(&adap->demux);
- dvb_usbv2_media_device_unregister(adap);
dvb_unregister_adapter(&adap->dvb_adap);
}
@@ -852,6 +851,7 @@ static int dvb_usbv2_adapter_exit(struct dvb_usb_device *d)
dvb_usbv2_adapter_dvb_exit(&d->adapter[i]);
dvb_usbv2_adapter_stream_exit(&d->adapter[i]);
dvb_usbv2_adapter_frontend_exit(&d->adapter[i]);
+ dvb_usbv2_media_device_unregister(&d->adapter[i]);
}
}