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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <s5hd33fknfg.wl%tiwai@suse.de>
Date:	Sun, 29 Jul 2012 09:59:31 +0200
From:	Takashi Iwai <tiwai@...e.de>
To:	Daniel Mack <zonque@...il.com>
Cc:	Fengguang Wu <fengguang.wu@...el.com>,
	Krzysztof Helt <krzysztof.h1@...pl>,
	LKML <linux-kernel@...r.kernel.org>,
	Rene Herman <rene.herman@...il.com>
Subject: Re: genirq: Flags mismatch irq 5. 00000000 (ES1688) vs. 00000000

At Sat, 28 Jul 2012 17:13:53 +0200,
Daniel Mack wrote:
> 
> diff --git a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c
> index 1d47be8..7cb309a 100644
> --- a/sound/isa/es1688/es1688_lib.c
> +++ b/sound/isa/es1688/es1688_lib.c
> @@ -658,18 +658,25 @@ int snd_es1688_create(struct snd_card *card,
>  	chip->irq = -1;
>  	chip->dma8 = -1;
>  	
> -	if ((chip->res_port = request_region(port + 4, 12, "ES1688")) == NULL) {
> +	chip->res_port = request_region(port + 4, 12, "ES1688");
> +	if (chip->res_port == NULL) {
>  		snd_printk(KERN_ERR "es1688: can't grab port 0x%lx\n", port + 4);
> -		return -EBUSY;
> +		err = -EBUSY;
> +		goto exit;
>  	}
> -	if (request_irq(irq, snd_es1688_interrupt, 0, "ES1688", (void *) chip)) {
> +
> +	err = request_irq(irq, snd_es1688_interrupt, 0, "ES1688", (void *) chip);
> +	if (err < 0) {
>  		snd_printk(KERN_ERR "es1688: can't grab IRQ %d\n", irq);
> -		return -EBUSY;
> +		goto exit_release_region;
>  	}
> +
>  	chip->irq = irq;
> -	if (request_dma(dma8, "ES1688")) {
> +	err = request_dma(dma8, "ES1688");
> +
> +	if (err < 0) {
>  		snd_printk(KERN_ERR "es1688: can't grab DMA8 %d\n", dma8);
> -		return -EBUSY;
> +		goto exit_release_irq;
>  	}
>  	chip->dma8 = dma8;
>  
> @@ -685,14 +692,23 @@ int snd_es1688_create(struct snd_card *card,
>  
>  	err = snd_es1688_probe(chip);
>  	if (err < 0)
> -		return err;
> +		goto exit_release_dma;
>  
>  	err = snd_es1688_init(chip, 1);
>  	if (err < 0)
> -		return err;
> +		goto exit_release_dma;
>  
>  	/* Register device */
>  	return snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
> +
> +exit_release_dma:
> +	free_dma(chip->dma8);
> +exit_release_irq:
> +	free_irq(chip->irq, chip);
> +exit_release_region:
> +	release_and_free_resource(chip->res_port);
> +exit:
> +	return err;

You can simply call snd_es1688_free(chip) instead of a bunch of
labels.  That is, all goto's can be "goto exit", and

  exit:
	snd_es1688_free(chip);
	return err;

thanks,

Takashi
--
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