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

Commit 2fd9c2ea authored by Jean-Francois Moine's avatar Jean-Francois Moine Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (10385): gspca - main: Fix memory leak when USB disconnection while streaming.



Resetting the streaming flag on disconnection prevented the URBs to be freed
when streaming was active.
Also, USBs cannot be killed after disconnection (oops in [usbcore] unlink1).

Signed-off-by: default avatarJean-Francois Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 9c06210b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -423,6 +423,7 @@ static void destroy_urbs(struct gspca_dev *gspca_dev)
			break;

		gspca_dev->urb[i] = NULL;
		if (!gspca_dev->present)
			usb_kill_urb(urb);
		if (urb->transfer_buffer != NULL)
			usb_buffer_free(gspca_dev->dev,
@@ -1950,7 +1951,6 @@ void gspca_disconnect(struct usb_interface *intf)
	struct gspca_dev *gspca_dev = usb_get_intfdata(intf);

	gspca_dev->present = 0;
	gspca_dev->streaming = 0;

	usb_set_intfdata(intf, NULL);