Commit c9458c6f authored by Nil Yi's avatar Nil Yi Committed by Mauro Carvalho Chehab
Browse files

media: rc: clean the freed urb pointer to avoid double free



After freed rx_urb, we should set the second interface urb to NULL,
otherwise a double free would happen when the driver is removed
from the first interface.

Signed-off-by: default avatarNil Yi <teroincn@163.com>
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent afae4ef7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2358,8 +2358,10 @@ static struct imon_context *imon_init_intf1(struct usb_interface *intf,
touch_setup_failed:
find_endpoint_failed:
	usb_put_dev(ictx->usbdev_intf1);
	ictx->usbdev_intf1 = NULL;
	mutex_unlock(&ictx->lock);
	usb_free_urb(rx_urb);
	ictx->rx_urb_intf1 = NULL;
rx_urb_alloc_failed:
	dev_err(ictx->dev, "unable to initialize intf1, err %d\n", ret);