Skip to content

Commit

Permalink
[media] em28xx: use after free in em28xx_v4l2_close()
Browse files Browse the repository at this point in the history
We need to move the unlock before the kfree(dev);

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed Aug 15, 2012
1 parent 5359805 commit e36c92f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/usb/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -2264,9 +2264,9 @@ static int em28xx_v4l2_close(struct file *filp)
if (dev->state & DEV_DISCONNECTED) {
em28xx_release_resources(dev);
kfree(dev->alt_max_pkt_size);
mutex_unlock(&dev->lock);
kfree(dev);
kfree(fh);
mutex_unlock(&dev->lock);
return 0;
}

Expand Down

0 comments on commit e36c92f

Please sign in to comment.