All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Chen <lchen.firstlove@zohomail.com>
To: "Kishon Vijay Abraham I" <kishon@ti.com>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"\"Krzysztof Wilczyński\"" <kw@linux.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	linux-pci <linux-pci@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] PCI: endpoint fix misused goto label
Date: Fri, 21 Jan 2022 15:48:23 +0800	[thread overview]
Message-ID: <17e7b9b9ee6.c6d9c6a02564.4545388417402742326@zohomail.com> (raw)
In-Reply-To: 

From: Li Chen <lchen@ambarella.com>

If we goto err_map_addr here, buf allocated
via kmalloc won't get freeed, then memoryleak.

Signed-off-by: Li Chen <lchen@ambarella.com>
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index 96489cfdf58db..60303223976a1 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -441,7 +441,7 @@ static int pci_epf_test_write(struct pci_epf_test *epf_test)
 		if (!epf_test->dma_supported) {
 			dev_err(dev, "Cannot transfer data using DMA\n");
 			ret = -EINVAL;
-			goto err_map_addr;
+			goto err_dma_map;
 		}
 
 		src_phys_addr = dma_map_single(dma_dev, buf, reg->size,
-- 
2.34.1



             reply	other threads:[~2022-01-21  7:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-21  7:48 Li Chen [this message]
2022-02-08  6:47 ` [PATCH] PCI: endpoint fix misused goto label Li Chen
2022-02-08  6:59 ` Kishon Vijay Abraham I

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=17e7b9b9ee6.c6d9c6a02564.4545388417402742326@zohomail.com \
    --to=lchen.firstlove@zohomail.com \
    --cc=bhelgaas@google.com \
    --cc=kishon@ti.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.