mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-15 01:24:33 +00:00
[media] EM28xx - Fix memory leak on disconnect or error
Release the dev->alt_max_pkt_size buffer in all cases. Signed-off-by: Chris Rankin <rankincj@yahoo.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
7577911244
commit
16e3d2f4fa
@ -3201,6 +3201,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
|
||||
retval = em28xx_init_dev(&dev, udev, interface, nr);
|
||||
if (retval) {
|
||||
mutex_unlock(&dev->lock);
|
||||
kfree(dev->alt_max_pkt_size);
|
||||
kfree(dev);
|
||||
goto err;
|
||||
}
|
||||
|
@ -2200,6 +2200,7 @@ static int em28xx_v4l2_close(struct file *filp)
|
||||
free the remaining resources */
|
||||
if (dev->state & DEV_DISCONNECTED) {
|
||||
em28xx_release_resources(dev);
|
||||
kfree(dev->alt_max_pkt_size);
|
||||
kfree(dev);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user