Skip to contentSkip to conversation

XHCI: Fix memory leak in error condition

PATCH In review Vivek Kumar Bhagat 3 participants 4 messages Jun 26, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 XHCI: Fix memory leak in error condition

EP-EC562D6B53594479BCA6FC73F17DEE54
In error condition, td buffer is not freed which can lead to memory leak.

---
 drivers/usb/host/xhci.c |    1 +
 1 file changed, 1 insertion(+)
drivers/usb/host/xhci.c +1 -0
index 36bf089..dc02532 100644
@@ -1438,6 +1438,7 @@ dying:
 	ret = -ESHUTDOWN;
 free_priv:
 	xhci_urb_free_priv(urb_priv);
+	kfree(buffer);
 	urb->hcpriv = NULL;
 	spin_unlock_irqrestore(&xhci->lock, flags);
 	return ret;
Signature · 1 line
1.7.9.5���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�
#1 lore raw
Quoted 15 lines · Vivek Kumar Bhagat

EP-EC562D6B53594479BCA6FC73F17DEE54
In error condition, td buffer is not freed which can lead to memory leak.

---
  drivers/usb/host/xhci.c |    1 +
  1 file changed, 1 insertion(+)
drivers/usb/host/xhci.c +0 -0
index 36bf089..dc02532 100644

drivers/usb/host/xhci.c dying: · line 1444

Quoted 7 lines
drivers/usb/host/xhci.c +1 -0
@@ -1438,6 +1438,7 @@ dying:
  	ret = -ESHUTDOWN;
  free_priv:
  	xhci_urb_free_priv(urb_priv);
+	kfree(buffer);
  	urb->hcpriv = NULL;
  	spin_unlock_irqrestore(&xhci->lock, flags);
  	return ret;

Do you need to fix up xhci_urb_free_priv() as well?

cheers,
-roger

maintainer
#3 lore raw
In reply to Vivek Kumar Bhagat
Quoted 8 lines · Vivek Kumar Bhagat

EP-EC562D6B53594479BCA6FC73F17DEE54
In error condition, td buffer is not freed which can lead to memory leak.

---
 drivers/usb/host/xhci.c |    1 +
 1 file changed, 1 insertion(+)

Also, please use scripts/get_maintainer.pl to determine who to send patches to. Hint, I'm not the one for this patch, I can't do anything with it...