diff options
author | Oliver Neukum <oliver@neukum.org> | 2008-10-21 10:39:04 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-10-22 19:05:29 +0200 |
commit | a496c64f1363ec4d67ebdc1e1f619ad6372a574c (patch) | |
tree | c370f2167bbe2e4677bb7c48aa2cd7f8c2d888a6 /drivers/usb/class/cdc-acm.c | |
parent | USB: Unusual dev for Mio moov 330 gps (diff) | |
download | linux-a496c64f1363ec4d67ebdc1e1f619ad6372a574c.tar.xz linux-a496c64f1363ec4d67ebdc1e1f619ad6372a574c.zip |
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: Oliver Neukum <oneukum@suse.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/class/cdc-acm.c')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index fab23ee8702b..20104443081a 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -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); } } |