Re: [PATCH] ALSA: via82xx: Use common error handling code in snd_via82xx_create()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 22, 2017 at 07:43:08PM +0200, SF Markus Elfring wrote:
> @@ -1121,30 +1121,27 @@ static int snd_via82xx_create(struct snd_card *card,
>  
>  	if ((err = pci_request_regions(pci, card->driver)) < 0) {
>  		kfree(chip);
> -		pci_disable_device(pci);
> -		return err;
> +		goto disable_device;
>  	}

[ snip ]

> @@ -1153,6 +1150,14 @@ static int snd_via82xx_create(struct snd_card *card,
>  
>  	*r_via = chip;
>  	return 0;
> +
> +disable_device:
> +	pci_disable_device(pci);
> +	goto exit;

Why is this "goto exit" here?  It's leaking now.

> +free_chip:
> +	snd_via82xx_free(chip);
> +exit:
> +	return err;
>  }

regards,
dan carpenter
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux