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] [day] [month] [year] [list]
Message-ID: <s5hlft5mlbd.wl-tiwai@suse.de>
Date:   Mon, 28 Oct 2019 07:32:54 +0100
From:   Takashi Iwai <tiwai@...e.de>
To:     Navid Emamdoost <navid.emamdoost@...il.com>
Cc:     emamd001@....edu, kjlu@....edu, smccaman@....edu,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Richard Fontana <rfontana@...hat.com>,
        alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ALSA: pci: Fix memory leak in snd_ali_create

On Sun, 27 Oct 2019 19:30:27 +0100,
Navid Emamdoost wrote:
> 
> In the implementation of snd_ali_create() the memory allocated for codec
> is leaked in case of an error. Release codec if snd_ali_chip_init()
> fails.

Once again, this is a wrong fix.  The code path is after
snd_device_new() with the free op, so the object gets already released
there.


thanks,

Takashi

> 
> Fixes: f9ab2b1c3ab5 ("[ALSA] ali5451 - Code clean up, irq handler fix")
> Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
> ---
>  sound/pci/ali5451/ali5451.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
> index 6e28e381c21a..3ed07a18be4d 100644
> --- a/sound/pci/ali5451/ali5451.c
> +++ b/sound/pci/ali5451/ali5451.c
> @@ -2179,6 +2179,7 @@ static int snd_ali_create(struct snd_card *card,
>  	err = snd_ali_chip_init(codec);
>  	if (err < 0) {
>  		dev_err(card->dev, "ali create: chip init error.\n");
> +		snd_ali_free(codec);
>  		return err;
>  	}
>  
> -- 
> 2.17.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ