提交 42c3d418 编写于 作者: D Dexuan Cui 提交者: 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: NDexuan Cui <decui@microsoft.com>
Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: NMichael Kelley <mikelley@microsoft.com>
上级 e658a4fe
...@@ -3058,7 +3058,7 @@ static int hv_pci_probe(struct hv_device *hdev, ...@@ -3058,7 +3058,7 @@ static int hv_pci_probe(struct hv_device *hdev,
free_dom: free_dom:
hv_put_dom_num(hbus->sysdata.domain); hv_put_dom_num(hbus->sysdata.domain);
free_bus: free_bus:
free_page((unsigned long)hbus); kfree(hbus);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册