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

Commit a496c64f authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman
Browse files

USB: fix memory leak in cdc-acm



This fixes a memory leak on disconnect in cdc-acm

Thanks to 施金前 for finding it.

Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e8fab4ce
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -849,9 +849,10 @@ static void acm_write_buffers_free(struct acm *acm)
{
	int i;
	struct acm_wb *wb;
	struct usb_device *usb_dev = interface_to_usbdev(acm->control);

	for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++) {
		usb_buffer_free(acm->dev, acm->writesize, wb->buf, wb->dmah);
		usb_buffer_free(usb_dev, acm->writesize, wb->buf, wb->dmah);
	}
}