summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2009-09-23 16:09:56 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2009-10-09 22:52:06 +0200
commit696a4ace98b6b9c05c642a6840be98d6fde57655 (patch)
treebd7bc6dc6283298c8e6877bce8967f2bb6ef4390 /drivers/usb
parentUSB: serial: sierra driver version change to 1.3.8 (diff)
downloadlinux-696a4ace98b6b9c05c642a6840be98d6fde57655.tar.xz
linux-696a4ace98b6b9c05c642a6840be98d6fde57655.zip
USB: usblcd, fix memory leak
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/misc/usblcd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
index 29092b8e59ce..4fb120357c55 100644
--- a/drivers/usb/misc/usblcd.c
+++ b/drivers/usb/misc/usblcd.c
@@ -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 */