summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2012-10-31 20:48:54 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-05 09:56:51 +0100
commit7b746b16909444af2d207b010b89885591ea54d0 (patch)
tree1d7a45e976592a4328698cb8f3c6153cef26c55b
parent0813e85449a343a214462346f146f7b0f6a2053d (diff)
USB: iuu_phoenix: fix backported patches
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>
-rw-r--r--drivers/usb/serial/iuu_phoenix.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c
index cdf0f994e883..8d3692bef861 100644
--- a/drivers/usb/serial/iuu_phoenix.c
+++ b/drivers/usb/serial/iuu_phoenix.c
@@ -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);