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

Commit 16e3d2f4 authored by Chris Rankin's avatar Chris Rankin Committed by Mauro Carvalho Chehab
Browse files

[media] EM28xx - Fix memory leak on disconnect or error



Release the dev->alt_max_pkt_size buffer in all cases.

Signed-off-by: default avatarChris Rankin <rankincj@yahoo.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 75779112
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
	}
+1 −0
Original line number Diff line number Diff line
@@ -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;
		}