From: Julia Lawall Date: Sun, 25 Mar 2012 19:08:32 +0000 (+0200) Subject: drivers/usb/misc/usbtest.c: add kfrees X-Git-Tag: v3.4~160^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f4a728d09a96d6a83d9c3f39035b1aa7726892ea;p=platform%2Fkernel%2Flinux-amlogic.git drivers/usb/misc/usbtest.c: add kfrees Free the two previously allocated buffers before exiting the function in an error case. Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index cac67de..9dcb68f 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -2277,6 +2277,8 @@ usbtest_probe(struct usb_interface *intf, const struct usb_device_id *id) if (status < 0) { WARNING(dev, "couldn't get endpoints, %d\n", status); + kfree(dev->buf); + kfree(dev); return status; } /* may find bulk or ISO pipes */