Skip to content

Commit

Permalink
[media] usbvision-video: two use after frees
Browse files Browse the repository at this point in the history
The lock has been freed in usbvision_release() so there is no need to
call mutex_unlock() here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed Oct 24, 2014
1 parent a4789e6 commit 470a914
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/media/usb/usbvision/usbvision-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ static int usbvision_v4l2_close(struct file *file)
if (usbvision->remove_pending) {
printk(KERN_INFO "%s: Final disconnect\n", __func__);
usbvision_release(usbvision);
return 0;
}
mutex_unlock(&usbvision->v4l2_lock);

Expand Down Expand Up @@ -1221,6 +1222,7 @@ static int usbvision_radio_close(struct file *file)
if (usbvision->remove_pending) {
printk(KERN_INFO "%s: Final disconnect\n", __func__);
usbvision_release(usbvision);
return err_code;
}

mutex_unlock(&usbvision->v4l2_lock);
Expand Down

0 comments on commit 470a914

Please sign in to comment.