ChangeSet 1.925.62.4, 2003/02/07 16:45:32+11:00, randy.dunlap@verizon.net [PATCH] USB: cdc-acm memory leak The Stanford Checker discovered a memory leak in cdc-acm. This patch to 2.5.59 fixes it. Please apply. diff -Nru a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c --- a/drivers/usb/class/cdc-acm.c Tue Feb 18 16:45:48 2003 +++ b/drivers/usb/class/cdc-acm.c Tue Feb 18 16:45:48 2003 @@ -606,6 +606,7 @@ if (!acm->ctrlurb) { err("out of memory"); kfree(acm); + kfree(buf); return -ENOMEM; } acm->readurb = usb_alloc_urb(0, GFP_KERNEL); @@ -613,6 +614,7 @@ err("out of memory"); usb_free_urb(acm->ctrlurb); kfree(acm); + kfree(buf); return -ENOMEM; } acm->writeurb = usb_alloc_urb(0, GFP_KERNEL); @@ -621,6 +623,7 @@ usb_free_urb(acm->readurb); usb_free_urb(acm->ctrlurb); kfree(acm); + kfree(buf); return -ENOMEM; }