提交 c058f7ab 编写于 作者: S Sachin Kamat 提交者: Greg Kroah-Hartman

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: NSachin Kamat <sachin.kamat@linaro.org>
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 564e6989
......@@ -1786,7 +1786,8 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
if (dev->actconfig && usb_disable_lpm(dev)) {
dev_err(&dev->dev, "%s Failed to disable LPM\n.", __func__);
mutex_unlock(hcd->bandwidth_mutex);
return -ENOMEM;
ret = -ENOMEM;
goto free_interfaces;
}
ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL);
if (ret < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册