diff options
| author | Daeseok Youn <daeseok.youn@gmail.com> | 2014-04-01 06:15:59 -0400 |
|---|---|---|
| committer | David Vrabel <david.vrabel@citrix.com> | 2014-04-15 12:32:30 -0400 |
| commit | cea37f87519ca3172a4e8ddd3ffcd2b4232b341f (patch) | |
| tree | e9f0960879b3f2dca738eb363be06b0d47e7b3c1 | |
| parent | 4461bbc05bf11fa4251acded60e4645863a4158a (diff) | |
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: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
| -rw-r--r-- | drivers/xen/xen-pciback/vpci.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/xen/xen-pciback/vpci.c b/drivers/xen/xen-pciback/vpci.c index 3165ce361b00..51afff96c515 100644 --- a/drivers/xen/xen-pciback/vpci.c +++ b/drivers/xen/xen-pciback/vpci.c | |||
| @@ -137,6 +137,8 @@ unlock: | |||
| 137 | /* Publish this device. */ | 137 | /* Publish this device. */ |
| 138 | if (!err) | 138 | if (!err) |
| 139 | err = publish_cb(pdev, 0, 0, PCI_DEVFN(slot, func), devid); | 139 | err = publish_cb(pdev, 0, 0, PCI_DEVFN(slot, func), devid); |
| 140 | else | ||
| 141 | kfree(dev_entry); | ||
| 140 | 142 | ||
| 141 | out: | 143 | out: |
| 142 | return err; | 144 | return err; |
