diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2012-11-21 00:31:19 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-21 16:32:26 -0500 |
commit | c058f7ab94143dfa2286e496019b7ad0b95502ac (patch) | |
tree | 22b177b561485b6e2dffac1227934061d862e84a /drivers/usb | |
parent | 564e69893c63cefe4bcbdeda4f940bf68b6b4491 (diff) |
USB: core: Free the allocated memory before exiting on error
'new_interfaces' should be freed to avoid memory leak.
Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/message.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 73c5d1a04135..131f73649b60 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -1786,7 +1786,8 @@ free_interfaces: | |||
1786 | if (dev->actconfig && usb_disable_lpm(dev)) { | 1786 | if (dev->actconfig && usb_disable_lpm(dev)) { |
1787 | dev_err(&dev->dev, "%s Failed to disable LPM\n.", __func__); | 1787 | dev_err(&dev->dev, "%s Failed to disable LPM\n.", __func__); |
1788 | mutex_unlock(hcd->bandwidth_mutex); | 1788 | mutex_unlock(hcd->bandwidth_mutex); |
1789 | return -ENOMEM; | 1789 | ret = -ENOMEM; |
1790 | goto free_interfaces; | ||
1790 | } | 1791 | } |
1791 | ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL); | 1792 | ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL); |
1792 | if (ret < 0) { | 1793 | if (ret < 0) { |