]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
USB: iuu_phoenix: fix backported patches
authorJohan Hovold <jhovold@gmail.com>
Wed, 31 Oct 2012 19:48:54 +0000 (20:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Nov 2012 08:56:51 +0000 (09:56 +0100)
Fix two memory leaks involving dbgbuf that were introduced in port-probe
error paths when backporting the following port-data fixes from v3.7
(which doesn't have dbgbuf):

0978c94 USB: iuu_phoenix: fix sysfs-attribute creation
5363655 USB: iuu_phoenix: fix port-data memory leak

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/iuu_phoenix.c

index cdf0f994e883a58eaf7f24d843237d6b41f74015..8d3692bef861f89d947e7066a571d89eacd1652a 100644 (file)
@@ -105,7 +105,7 @@ static int iuu_port_probe(struct usb_serial_port *port)
        }
 
        priv->dbgbuf = kzalloc(256, GFP_KERNEL);
-       if (!priv->writebuf) {
+       if (!priv->dbgbuf) {
                kfree(priv->writebuf);
                kfree(priv->buf);
                kfree(priv);
@@ -120,6 +120,7 @@ static int iuu_port_probe(struct usb_serial_port *port)
 
        ret = iuu_create_sysfs_attrs(port);
        if (ret) {
+               kfree(priv->dbgbuf);
                kfree(priv->writebuf);
                kfree(priv->buf);
                kfree(priv);