Commit 42c3d418 authored by Dexuan Cui's avatar Dexuan Cui Committed by Lorenzo Pieralisi

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: 877b911a ("PCI: hv: Avoid a kmemleak false positive caused by the hbus buffer")
Signed-off-by: default avatarDexuan Cui <decui@microsoft.com>
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: default avatarMichael Kelley <mikelley@microsoft.com>
parent e658a4fe
......@@ -3058,7 +3058,7 @@ static int hv_pci_probe(struct hv_device *hdev,
free_dom:
hv_put_dom_num(hbus->sysdata.domain);
free_bus:
free_page((unsigned long)hbus);
kfree(hbus);
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment