Message ID | 1353475879-30450-1-git-send-email-sachin.kamat@linaro.org |
---|---|
State | Accepted |
Headers | show |
On Wed, 21 Nov 2012, Sachin Kamat wrote: > 'new_interfaces' should be freed to avoid memory leak. > > Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com> > Cc: Alan Stern <stern@rowland.harvard.edu> > Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> > --- > 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 a557658..1653f56 100644 > --- a/drivers/usb/core/message.c > +++ b/drivers/usb/core/message.c > @@ -1795,7 +1795,8 @@ free_interfaces: > 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) { Good catch, thank you. Acked-by: Alan Stern <stern@rowland.harvard.edu>
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index a557658..1653f56 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -1795,7 +1795,8 @@ free_interfaces: 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) {
'new_interfaces' should be freed to avoid memory leak. Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> --- drivers/usb/core/message.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)