From: Axel Lin Date: Mon, 21 Jun 2010 00:44:17 +0000 (+0800) Subject: USB: qcserial: fix a memory leak in qcprobe error path X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=0d152de56938361fa2b960db67657b20cdaa6d84;p=deliverable%2Flinux.git USB: qcserial: fix a memory leak in qcprobe error path This patch adds missing kfree(data) before return -ENODEV. Signed-off-by: Axel Lin Signed-off-by: Greg Kroah-Hartman --- 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; }