Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e36c92fd authored by Dan Carpenter's avatar Dan Carpenter Committed by Mauro Carvalho Chehab
Browse files

[media] em28xx: use after free in em28xx_v4l2_close()



We need to move the unlock before the kfree(dev);

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 53598051
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
		}