From: Jiri Slaby Date: Wed, 23 Sep 2009 14:09:56 +0000 (+0200) Subject: USB: usblcd, fix memory leak X-Git-Tag: MMI-PSA29.97-13-9~26144^2~23 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=696a4ace98b6b9c05c642a6840be98d6fde57655;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: Greg Kroah-Hartman --- 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 */