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]
Message-ID: <AANLkTimkb4ic3G7rT-WiFtFdC+Sy5gVAikoQVXguVH4J@mail.gmail.com>
Date:	Tue, 11 Jan 2011 19:19:14 -0500
From:	Mike Frysinger <vapier.adi@...il.com>
To:	Axel Lin <axel.lin@...il.com>
Cc:	linux-kernel@...r.kernel.org, Liam Girdwood <lrg@...mlogic.co.uk>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	alsa-devel@...a-project.org
Subject: Re: [PATCH] ASoC: Fix resource leak if soc_register_ac97_dai_link failed

On Tue, Dec 7, 2010 at 07:56, Axel Lin wrote:
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1619,12 +1619,14 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
>  #ifdef CONFIG_SND_SOC_AC97_BUS
>        /* register any AC97 codecs */
>        for (i = 0; i < card->num_rtd; i++) {
> -                       ret = soc_register_ac97_dai_link(&card->rtd[i]);
> -                       if (ret < 0) {
> -                               printk(KERN_ERR "asoc: failed to register AC97 %s\n", card->name);
> -                               goto probe_dai_err;
> -                       }
> +               ret = soc_register_ac97_dai_link(&card->rtd[i]);
> +               if (ret < 0) {
> +                       printk(KERN_ERR "asoc: failed to register AC97 %s\n", card->name);
> +                       while (--i >= 0)
> +                               soc_unregister_ac97_dai_link(&card->rtd[i]);
> +                       goto probe_dai_err;
>                }
> +       }
>  #endif

this isnt entirely correct.  soc_unregister_ac97_dai_link takes a
pointer to a codec which card->rtd[i] is not.
sound/soc/soc-core.c: In function ‘snd_soc_instantiate_card’:
sound/soc/soc-core.c:1626: warning: passing argument 1 of
‘soc_unregister_ac97_dai_link’ from incompatible pointer type
-mike

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ