summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-06-21 02:44:17 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-06-30 17:16:06 +0200
commit0d152de56938361fa2b960db67657b20cdaa6d84 (patch)
treebb5c65990a747423ef283fd56e9ff40444e26f9f /drivers/usb
parentUSB: gadget/printer, fix sleep inside atomic (diff)
downloadlinux-0d152de56938361fa2b960db67657b20cdaa6d84.tar.xz
linux-0d152de56938361fa2b960db67657b20cdaa6d84.zip
USB: qcserial: fix a memory leak in qcprobe error path
This patch adds missing kfree(data) before return -ENODEV. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/qcserial.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
index 04bb759536bb..93d72eb8cafc 100644
--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -139,6 +139,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
"Could not set interface, error %d\n",
retval);
retval = -ENODEV;
+ kfree(data);
}
return retval;
}
@@ -155,6 +156,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
"Could not set interface, error %d\n",
retval);
retval = -ENODEV;
+ kfree(data);
}
return retval;
}
@@ -163,6 +165,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
default:
dev_err(&serial->dev->dev,
"unknown number of interfaces: %d\n", nintf);
+ kfree(data);
return -ENODEV;
}