Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Max Kellermann and committed by
Mauro Carvalho Chehab
4d5030b6 1f4ed6cd

+2 -1
+2 -1
drivers/media/dvb-core/dvb_ca_en50221.c
··· 171 171 { 172 172 unsigned int i; 173 173 174 - dvb_unregister_device(ca->dvbdev); 174 + dvb_free_device(ca->dvbdev); 175 175 for (i = 0; i < ca->slot_count; i++) 176 176 vfree(ca->slot_info[i].rx_buffer.data); 177 177 ··· 1807 1807 for (i = 0; i < ca->slot_count; i++) { 1808 1808 dvb_ca_en50221_slot_shutdown(ca, i); 1809 1809 } 1810 + dvb_remove_device(ca->dvbdev); 1810 1811 dvb_ca_private_put(ca); 1811 1812 pubca->private = NULL; 1812 1813 }