mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] xen: fix memory leak in __xen_pcibk_add_pci_dev()
@ 2014-03-31 10:08 Daeseok Youn
  2014-04-01  7:23 ` [Xen-devel] " Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Daeseok Youn @ 2014-03-31 10:08 UTC (permalink / raw)
  To: konrad.wilk; +Cc: boris.ostrovsky, david.vrabel, joe, xen-devel, linux-kernel


It need to free dev_entry when it failed to assign to a new
slot on the virtual PCI bus.

smatch says:
 drivers/xen/xen-pciback/vpci.c:142 __xen_pcibk_add_pci_dev() warn:
possible memory leak of 'dev_entry'

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 drivers/xen/xen-pciback/vpci.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/xen/xen-pciback/vpci.c b/drivers/xen/xen-pciback/vpci.c
index 3165ce3..657e50f 100644
--- a/drivers/xen/xen-pciback/vpci.c
+++ b/drivers/xen/xen-pciback/vpci.c
@@ -130,6 +130,7 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
 	err = -ENOMEM;
 	xenbus_dev_fatal(pdev->xdev, err,
 			 "No more space on root virtual PCI bus");
+	kfree(dev_entry);
 
 unlock:
 	mutex_unlock(&vpci_dev->lock);
-- 
1.7.4.4



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-01  8:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-31 10:08 [PATCH] xen: fix memory leak in __xen_pcibk_add_pci_dev() Daeseok Youn
2014-04-01  7:23 ` [Xen-devel] " Jan Beulich
2014-04-01  8:17   ` DaeSeok Youn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®