All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -repost 1/1] USB: usblcd, fix memory leak
@ 2009-10-09 14:10 Jiri Slaby
  2009-10-09 17:25 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Slaby @ 2009-10-09 14:10 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 related	[flat|nested] 2+ messages in thread

* Re: [PATCH -repost 1/1] USB: usblcd, fix memory leak
  2009-10-09 14:10 [PATCH -repost 1/1] USB: usblcd, fix memory leak Jiri Slaby
@ 2009-10-09 17:25 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2009-10-09 17:25 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: gregkh, linux-usb, linux-kernel

On Fri, Oct 09, 2009 at 04:10:28PM +0200, Jiri Slaby wrote:
> 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>

Sorry for the delay, just now picked up your original patch.

thanks,

greg "my inbox sucks" k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-09 18:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-09 14:10 [PATCH -repost 1/1] USB: usblcd, fix memory leak Jiri Slaby
2009-10-09 17:25 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.