提交 cea37f87 编写于 作者: D Daeseok Youn 提交者: David Vrabel

xen: fix memory leak in __xen_pcibk_add_pci_dev()

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: NDaeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
上级 4461bbc0
......@@ -137,6 +137,8 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
/* Publish this device. */
if (!err)
err = publish_cb(pdev, 0, 0, PCI_DEVFN(slot, func), devid);
else
kfree(dev_entry);
out:
return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册