summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-core
diff options
context:
space:
mode:
authorMax Kellermann <max.kellermann@gmail.com>2016-08-09 23:32:16 +0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-18 18:03:45 +0100
commit4d5030b69bb4880a760406a6d3d519f02b9351dc (patch)
tree5ed43ebf560d962f860fb012a04c6c98be45ea2d /drivers/media/dvb-core
parent[media] dvbdev: split dvb_unregister_device() (diff)
downloadlinux-4d5030b69bb4880a760406a6d3d519f02b9351dc.tar.xz
linux-4d5030b69bb4880a760406a6d3d519f02b9351dc.zip
[media] dvb-core/en50221: use dvb_remove_device()
Commit da677fe14364 ("[media] dvb-core/en50221: use kref to manage struct dvb_ca_private") moved the dvb_unregister_device() call to the kref callback, but that left lots of stale device state visible to userspace (e.g. in sysfs). By using dvb_remove_device() and dvb_free_device() instead of dvb_unregister_device(), we can avoid that. Signed-off-by: Max Kellermann <max.kellermann@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/dvb-core')
-rw-r--r--drivers/media/dvb-core/dvb_ca_en50221.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
index 262a492e7c08..fd893141211c 100644
--- a/drivers/media/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb-core/dvb_ca_en50221.c
@@ -171,7 +171,7 @@ static void dvb_ca_private_free(struct dvb_ca_private *ca)
{
unsigned int i;
- dvb_unregister_device(ca->dvbdev);
+ dvb_free_device(ca->dvbdev);
for (i = 0; i < ca->slot_count; i++)
vfree(ca->slot_info[i].rx_buffer.data);
@@ -1807,6 +1807,7 @@ void dvb_ca_en50221_release(struct dvb_ca_en50221 *pubca)
for (i = 0; i < ca->slot_count; i++) {
dvb_ca_en50221_slot_shutdown(ca, i);
}
+ dvb_remove_device(ca->dvbdev);
dvb_ca_private_put(ca);
pubca->private = NULL;
}