lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54A94313.1070207@users.sourceforge.net>
Date:	Sun, 04 Jan 2015 14:41:39 +0100
From:	SF Markus Elfring <elfring@...rs.sourceforge.net>
To:	Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>,
	alsa-devel@...a-project.org
CC:	LKML <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org,
	Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 13/13] ALSA: msnd: Fix centralized exiting from snd_msnd_attach()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sun, 4 Jan 2015 11:47:17 +0100

Two return statements were used by the snd_msnd_attach() function at source
code places where the Linux coding style recommends an alternative approach.

Let us improve the affected implementation details with adjustments for
corresponding jump targets.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 sound/isa/msnd/msnd_pinnacle.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/sound/isa/msnd/msnd_pinnacle.c b/sound/isa/msnd/msnd_pinnacle.c
index e2e940d..0e66e5e 100644
--- a/sound/isa/msnd/msnd_pinnacle.c
+++ b/sound/isa/msnd/msnd_pinnacle.c
@@ -552,17 +552,16 @@ static int snd_msnd_attach(struct snd_card *card)
 		return err;
 	}
 	if (request_region(chip->io, DSP_NUMIO, card->shortname) == NULL) {
-		free_irq(chip->irq, chip);
-		return -EBUSY;
+		err = -EBUSY;
+		goto free_an_irq;
 	}
 
 	if (!request_mem_region(chip->base, BUFFSIZE, card->shortname)) {
 		printk(KERN_ERR LOGNAME
 			": unable to grab memory region 0x%lx-0x%lx\n",
 			chip->base, chip->base + BUFFSIZE - 1);
-		release_region(chip->io, DSP_NUMIO);
-		free_irq(chip->irq, chip);
-		return -EBUSY;
+		err = -EBUSY;
+		goto release_resource_region;
 	}
 	chip->mappedbase = ioremap_nocache(chip->base, 0x8000);
 	if (!chip->mappedbase) {
@@ -570,7 +569,7 @@ static int snd_msnd_attach(struct snd_card *card)
 			": unable to map memory region 0x%lx-0x%lx\n",
 			chip->base, chip->base + BUFFSIZE - 1);
 		err = -EIO;
-		goto err_release_region;
+		goto release_memory_region;
 	}
 
 	err = snd_msnd_dsp_full_reset(card);
@@ -628,9 +627,11 @@ static int snd_msnd_attach(struct snd_card *card)
 
 io_unmap:
 	iounmap(chip->mappedbase);
-err_release_region:
+release_memory_region:
 	release_mem_region(chip->base, BUFFSIZE);
+release_resource_region:
 	release_region(chip->io, DSP_NUMIO);
+free_an_irq:
 	free_irq(chip->irq, chip);
 	return err;
 }
-- 
2.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ