提交 16e3d2f4 编写于 作者: C Chris Rankin 提交者: Mauro Carvalho Chehab

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

Release the dev->alt_max_pkt_size buffer in all cases.
Signed-off-by: NChris Rankin <rankincj@yahoo.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 75779112
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册