aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-04-19 11:27:56 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-04-19 16:23:38 -0400
commitee71e7b3ae1780e4475aa5dd980dd99c0309079b (patch)
tree4c15e0fc2f11ebd5fe5dee23575b87f7394566ed /drivers/media/radio
parentaa6d5f29534a6d1459f9768c591a7a72aadc5941 (diff)
[media] V4L: fix incorrect refcounting
Both radio-keene and dsbr100 did one v4l2_device_get too many. Thus the refcount never became 0 and that causes a memory leak. Also updated the V4L2 framework documentation accordingly. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r--drivers/media/radio/dsbr100.c1
-rw-r--r--drivers/media/radio/radio-keene.c1
2 files changed, 0 insertions, 2 deletions
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c
index f36905b6364..bf813a63ab2 100644
--- a/drivers/media/radio/dsbr100.c
+++ b/drivers/media/radio/dsbr100.c
@@ -481,7 +481,6 @@ static void usb_dsbr100_disconnect(struct usb_interface *intf)
481{ 481{
482 struct dsbr100_device *radio = usb_get_intfdata(intf); 482 struct dsbr100_device *radio = usb_get_intfdata(intf);
483 483
484 v4l2_device_get(&radio->v4l2_dev);
485 mutex_lock(&radio->v4l2_lock); 484 mutex_lock(&radio->v4l2_lock);
486 usb_set_intfdata(intf, NULL); 485 usb_set_intfdata(intf, NULL);
487 video_unregister_device(&radio->videodev); 486 video_unregister_device(&radio->videodev);
diff --git a/drivers/media/radio/radio-keene.c b/drivers/media/radio/radio-keene.c
index 26a2b7a0304..5f33047d0d4 100644
--- a/drivers/media/radio/radio-keene.c
+++ b/drivers/media/radio/radio-keene.c
@@ -148,7 +148,6 @@ static void usb_keene_disconnect(struct usb_interface *intf)
148{ 148{
149 struct keene_device *radio = to_keene_dev(usb_get_intfdata(intf)); 149 struct keene_device *radio = to_keene_dev(usb_get_intfdata(intf));
150 150
151 v4l2_device_get(&radio->v4l2_dev);
152 mutex_lock(&radio->lock); 151 mutex_lock(&radio->lock);
153 usb_set_intfdata(intf, NULL); 152 usb_set_intfdata(intf, NULL);
154 video_unregister_device(&radio->vdev); 153 video_unregister_device(&radio->vdev);