Эх сурвалжийг харах

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 <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Julia Lawall 13 жил өмнө
parent
commit
f4a728d09a

+ 2 - 0
drivers/usb/misc/usbtest.c

@@ -2277,6 +2277,8 @@ usbtest_probe(struct usb_interface *intf, const struct usb_device_id *id)
 			if (status < 0) {
 			if (status < 0) {
 				WARNING(dev, "couldn't get endpoints, %d\n",
 				WARNING(dev, "couldn't get endpoints, %d\n",
 						status);
 						status);
+				kfree(dev->buf);
+				kfree(dev);
 				return status;
 				return status;
 			}
 			}
 			/* may find bulk or ISO pipes */
 			/* may find bulk or ISO pipes */