Skip to content

Commit

Permalink
USB: usblcd, fix memory leak
Browse files Browse the repository at this point in the history
Stanse found a memory leak in lcd_probe. Instead of returning without
releasing the memory, jump to the error label which frees it.

http://stanse.fi.muni.cz/

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Oct 9, 2009
1 parent 0f0ba79 commit 696a4ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/misc/usblcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ static int lcd_probe(struct usb_interface *interface, const struct usb_device_id

if (le16_to_cpu(dev->udev->descriptor.idProduct) != 0x0001) {
dev_warn(&interface->dev, "USBLCD model not supported.\n");
return -ENODEV;
retval = -ENODEV;
goto error;
}

/* set up the endpoint information */
Expand Down

0 comments on commit 696a4ac

Please sign in to comment.