linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-kernel@vger.kernel.org>, <alsa-devel@alsa-project.org>
Cc: <perex@perex.cz>, <tiwai@suse.com>, <broonie@kernel.org>
Subject: [PATCH -next] ALSA: fm801: Fix missing pci_release_regions() on error in snd_fm801_create()
Date: Wed, 16 Jun 2021 10:55:07 +0800	[thread overview]
Message-ID: <20210616025507.2120103-1-yangyingliang@huawei.com> (raw)

Fix the missing pci_release_regions() before return
from snd_fm801_create() in the error handling case.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 sound/pci/fm801.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index ed9dae87145b..adac9c6a67f0 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -1254,6 +1254,7 @@ static int snd_fm801_create(struct snd_card *card,
 				IRQF_SHARED, KBUILD_MODNAME, chip)) {
 			dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 			snd_fm801_free(chip);
+			pci_release_regions(pci);
 			return -EBUSY;
 		}
 		chip->irq = pci->irq;
@@ -1266,6 +1267,7 @@ static int snd_fm801_create(struct snd_card *card,
 	err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
 	if (err < 0) {
 		snd_fm801_free(chip);
+		pci_release_regions(pci);
 		return err;
 	}
 
@@ -1273,6 +1275,7 @@ static int snd_fm801_create(struct snd_card *card,
 	err = v4l2_device_register(&pci->dev, &chip->v4l2_dev);
 	if (err < 0) {
 		snd_fm801_free(chip);
+		pci_release_regions(pci);
 		return err;
 	}
 	chip->tea.v4l2_dev = &chip->v4l2_dev;
@@ -1285,6 +1288,7 @@ static int snd_fm801_create(struct snd_card *card,
 		if (snd_tea575x_init(&chip->tea, THIS_MODULE)) {
 			dev_err(card->dev, "TEA575x radio not found\n");
 			snd_fm801_free(chip);
+			pci_release_regions(pci);
 			return -ENODEV;
 		}
 	} else if ((chip->tea575x_tuner & TUNER_TYPE_MASK) == 0) {
-- 
2.25.1


             reply	other threads:[~2021-06-16  2:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  2:55 Yang Yingliang [this message]
2021-06-16  6:50 ` [PATCH -next] ALSA: fm801: Fix missing pci_release_regions() on error in snd_fm801_create() Takashi Iwai
2021-06-16  7:02   ` Yang Yingliang

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=20210616025507.2120103-1-yangyingliang@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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;
as well as URLs for NNTP newsgroup(s).