USB: serial: Fix memory leak in sierra_release()
authorLennart Sorensen <lsorense@csclub.uwaterloo.ca>
Wed, 24 Oct 2012 14:23:09 +0000 (10:23 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Oct 2012 18:45:34 +0000 (11:45 -0700)
I found a memory leak in sierra_release() (well sierra_probe() I guess)
that looses 8 bytes each time the driver releases a device.

Signed-off-by: Len Sorensen <lsorense@csclub.uwaterloo.ca>
Acked-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/sierra.c

index 01d882cf3775a2523662e4ab40f917a91eac5099..76ef95bcbbf272599f9516636b913921e07e3ae2 100644 (file)
@@ -959,6 +959,7 @@ static void sierra_release(struct usb_serial *serial)
                        continue;
                kfree(portdata);
        }
+       kfree(serial->private);
 }
 
 #ifdef CONFIG_PM