Explorar el Código

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>
Jiri Slaby hace 16 años
padre
commit
696a4ace98
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      drivers/usb/misc/usblcd.c

+ 2 - 1
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 */