diff options
| author | 2020-02-21 21:59:57 -0800 | |
|---|---|---|
| committer | 2020-02-24 11:59:25 +0000 | |
| commit | 42c3d41832ef4fcf60aaa6f748de01ad99572adf (patch) | |
| tree | 16890813b3f796335684d14b6af5e7db497944af /drivers/pci/controller/pci-hyperv.c | |
| parent | PCI: hv: Remove unnecessary type casting from kzalloc (diff) | |
| download | linux-rng-42c3d41832ef4fcf60aaa6f748de01ad99572adf.tar.xz linux-rng-42c3d41832ef4fcf60aaa6f748de01ad99572adf.zip | |
PCI: hv: Add missing kfree(hbus) in hv_pci_probe()'s error handling path
Now that we use kzalloc() to allocate the hbus buffer, we must call
kfree() in the error path as well to prevent memory leakage.
Fixes: 877b911a5ba0 ("PCI: hv: Avoid a kmemleak false positive caused by the hbus buffer")
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Diffstat (limited to 'drivers/pci/controller/pci-hyperv.c')
| -rw-r--r-- | drivers/pci/controller/pci-hyperv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 0fe0283368d2..15011a349520 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -3058,7 +3058,7 @@ destroy_wq: free_dom: hv_put_dom_num(hbus->sysdata.domain); free_bus: - free_page((unsigned long)hbus); + kfree(hbus); return ret; } |
