public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Dejin Zheng <zhengdejin5@gmail.com>
To: rric@kernel.org, wsa+renesas@sang-engineering.com,
	jan.glauber@gmail.com, linux-i2c@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Dejin Zheng <zhengdejin5@gmail.com>
Subject: [PATCH] i2c: thunderx: Fix an issue about missing call to 'pci_free_irq_vectors()'
Date: Sun, 14 Feb 2021 22:37:34 +0800	[thread overview]
Message-ID: <20210214143734.591789-1-zhengdejin5@gmail.com> (raw)

Call to 'pci_free_irq_vectors()' are missing both in the error handling
path of the probe function, and in the remove function. So add them.

Fixes: 4c21541d8da17fb ("i2c: thunderx: Replace pci_enable_msix()")
Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
---
 drivers/i2c/busses/i2c-thunderx-pcidrv.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-thunderx-pcidrv.c b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
index 12c90aa0900e..6a338be4d4b7 100644
--- a/drivers/i2c/busses/i2c-thunderx-pcidrv.c
+++ b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
@@ -199,11 +199,11 @@ static int thunder_i2c_probe_pci(struct pci_dev *pdev,
 	ret = devm_request_irq(dev, pci_irq_vector(pdev, 0), octeon_i2c_isr, 0,
 			       DRV_NAME, i2c);
 	if (ret)
-		goto error;
+		goto error_free_irq;
 
 	ret = octeon_i2c_init_lowlevel(i2c);
 	if (ret)
-		goto error;
+		goto error_free_irq;
 
 	octeon_i2c_set_clock(i2c);
 
@@ -219,7 +219,7 @@ static int thunder_i2c_probe_pci(struct pci_dev *pdev,
 
 	ret = i2c_add_adapter(&i2c->adap);
 	if (ret)
-		goto error;
+		goto error_free_irq;
 
 	dev_info(i2c->dev, "Probed. Set system clock to %u\n", i2c->sys_freq);
 
@@ -229,6 +229,8 @@ static int thunder_i2c_probe_pci(struct pci_dev *pdev,
 
 	return 0;
 
+error_free_irq:
+	pci_free_irq_vectors(pdev);
 error:
 	thunder_i2c_clock_disable(dev, i2c->clk);
 	return ret;
@@ -238,6 +240,7 @@ static void thunder_i2c_remove_pci(struct pci_dev *pdev)
 {
 	struct octeon_i2c *i2c = pci_get_drvdata(pdev);
 
+	pci_free_irq_vectors(pdev);
 	thunder_i2c_smbus_remove(i2c);
 	thunder_i2c_clock_disable(&pdev->dev, i2c->clk);
 	i2c_del_adapter(&i2c->adap);
-- 
2.25.0


             reply	other threads:[~2021-02-14 14:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-14 14:37 Dejin Zheng [this message]
2021-02-18  9:29 ` [PATCH] i2c: thunderx: Fix an issue about missing call to 'pci_free_irq_vectors()' Robert Richter
2021-02-18  9:45 ` Robert Richter

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=20210214143734.591789-1-zhengdejin5@gmail.com \
    --to=zhengdejin5@gmail.com \
    --cc=jan.glauber@gmail.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rric@kernel.org \
    --cc=wsa+renesas@sang-engineering.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox