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:   Sun, 27 Oct 2019 21:40:21 +0100
From:   Markus Elfring <Markus.Elfring@....de>
To:     Navid Emamdoost <navid.emamdoost@...il.com>,
        alsa-devel@...a-project.org
Cc:     Navid Emamdoost <emamd001@....edu>, Kangjie Lu <kjlu@....edu>,
        Stephen McCamant <smccaman@....edu>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jaroslav Kysela <perex@...ex.cz>,
        Richard Fontana <rfontana@...hat.com>,
        Takashi Iwai <tiwai@...e.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        kernel-janitors@...r.kernel.org,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ALSA: pci: Fix memory leak in snd_korg1212_create

…
> +++ b/sound/pci/korg1212/korg1212.c
…
> @@ -2398,8 +2403,10 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci,
>
>          for (i = 0; i < ARRAY_SIZE(snd_korg1212_controls); i++) {
>                  err = snd_ctl_add(korg1212->card, snd_ctl_new1(&snd_korg1212_controls[i], korg1212));
> -                if (err < 0)
> +		if (err < 0) {
> +			snd_korg1212_free(korg1212);
>                          return err;
> +		}

I suggest to add a jump target according to the Linux coding style
so that duplicate exception handling code can be reduced.

 	return 0;

+free_korg:
+	snd_korg1212_free(korg1212);
+	return err;
 }


Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ