* [PATCH 1/1] USB: usblcd, fix memory leak
@ 2009-09-23 14:09 Jiri Slaby
0 siblings, 0 replies; only message in thread
From: Jiri Slaby @ 2009-09-23 14:09 UTC (permalink / raw)
To: gregkh; +Cc: linux-usb, linux-kernel, Jiri Slaby
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>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/usb/misc/usblcd.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
index 29092b8..4fb1203 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 */
--
1.6.4.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-09-23 14:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-23 14:09 [PATCH 1/1] USB: usblcd, fix memory leak Jiri Slaby
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®