From: Julia Lawall Date: Sun, 25 Mar 2012 19:08:32 +0000 (+0200) Subject: drivers/usb/misc/usbtest.c: add kfrees X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f4a728d09a96d6a83d9c3f39035b1aa7726892ea;p=linux-beck.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 cac67dea2bac..9dcb68f04f03 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 */