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]
Date:   Tue, 22 Aug 2017 22:05:37 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     Dan Carpenter <dan.carpenter@...cle.com>,
        alsa-devel@...a-project.org
Cc:     Jaroslav Kysela <perex@...ex.cz>,
        Julia Lawall <Julia.Lawall@...6.fr>,
        Takashi Iwai <tiwai@...e.com>,
        LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] ALSA: via82xx: Use common error handling code in
 snd_via82xx_create()

>> @@ -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?

Should the same return statement be reached after the proposed refactoring?

Would you like to move such a function call to this source code place?


> It's leaking now.

How do you come to this conclusion?


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

Is this update suggestion worth for another look?

Regards,
Markus

Powered by blists - more mailing lists