Skip to content

Commit

Permalink
drivers/usb/misc/usbtest.c: add kfrees
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julia Lawall authored and Greg Kroah-Hartman committed Apr 18, 2012
1 parent f941f69 commit f4a728d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/misc/usbtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit f4a728d

Please sign in to comment.