Commit 0d152de5 authored by Axel Lin's avatar Axel Lin Committed by Greg Kroah-Hartman

USB: qcserial: fix a memory leak in qcprobe error path

This patch adds missing kfree(data) before return -ENODEV.
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 10ca4425
...@@ -139,6 +139,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) ...@@ -139,6 +139,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
"Could not set interface, error %d\n", "Could not set interface, error %d\n",
retval); retval);
retval = -ENODEV; retval = -ENODEV;
kfree(data);
} }
return retval; return retval;
} }
...@@ -155,6 +156,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) ...@@ -155,6 +156,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
"Could not set interface, error %d\n", "Could not set interface, error %d\n",
retval); retval);
retval = -ENODEV; retval = -ENODEV;
kfree(data);
} }
return retval; return retval;
} }
...@@ -163,6 +165,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) ...@@ -163,6 +165,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
default: default:
dev_err(&serial->dev->dev, dev_err(&serial->dev->dev,
"unknown number of interfaces: %d\n", nintf); "unknown number of interfaces: %d\n", nintf);
kfree(data);
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment