archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <>
Cc: Dexuan Cui <>,
	Lorenzo Pieralisi <>,
	Michael Kelley <>,
	Sasha Levin <>,,
Subject: [PATCH AUTOSEL 5.5 109/121] PCI: hv: Add missing kfree(hbus) in hv_pci_probe()'s error handling path
Date: Sat, 11 Apr 2020 19:06:54 -0400	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

From: Dexuan Cui <>

[ Upstream commit 42c3d41832ef4fcf60aaa6f748de01ad99572adf ]

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 <>
Signed-off-by: Lorenzo Pieralisi <>
Reviewed-by: Michael Kelley <>
Signed-off-by: Sasha Levin <>
 drivers/pci/controller/pci-hyperv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index 9977abff92fc5..6b3cee4324047 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -3058,7 +3058,7 @@ static int hv_pci_probe(struct hv_device *hdev,
-	free_page((unsigned long)hbus);
+	kfree(hbus);
 	return ret;

       reply	other threads:[~2020-04-11 23:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <>
2020-04-11 23:06 ` Sasha Levin [this message]
2020-04-11 23:07 ` [PATCH AUTOSEL 5.5 121/121] PCI: Use ioremap(), not phys_to_virt() for platform ROM Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).