diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2010-10-11 11:36:37 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-20 23:18:15 -0400 |
commit | 9c84d89bf13b702ca0e0db5eb3880300c4bd58f4 (patch) | |
tree | c0b11f9fe5e386187881d59247a9e274046d7660 /drivers/media/radio | |
parent | 1cd72781db93c00fbee0bf4aed9e310a1d589738 (diff) |
[media] radio-mr800: fix locking order
Don't hold the lock before unregistering the device, since when the
device is unregistered the datastruct containing the lock may be freed
(if the refcount went to 0).
Also fixed the framework documentation that erroneously suggested the
wrong locking order as well.
Reported-by: David Ellingsworth <david@identd.dyndns.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: David Ellingsworth <david@identd.dyndns.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r-- | drivers/media/radio/radio-mr800.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index 97967ad3cd12..2f56b26cece9 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c | |||
@@ -285,8 +285,8 @@ static void usb_amradio_disconnect(struct usb_interface *intf) | |||
285 | 285 | ||
286 | mutex_lock(&radio->lock); | 286 | mutex_lock(&radio->lock); |
287 | v4l2_device_disconnect(&radio->v4l2_dev); | 287 | v4l2_device_disconnect(&radio->v4l2_dev); |
288 | video_unregister_device(&radio->videodev); | ||
289 | mutex_unlock(&radio->lock); | 288 | mutex_unlock(&radio->lock); |
289 | video_unregister_device(&radio->videodev); | ||
290 | } | 290 | } |
291 | 291 | ||
292 | /* vidioc_querycap - query device capabilities */ | 292 | /* vidioc_querycap - query device capabilities */ |