From: Takashi Iwai <tiwai@suse.de>
To: Dave Jones <davej@redhat.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: ad1848 double free
Date: Mon, 06 Mar 2006 14:52:11 +0100 [thread overview]
Message-ID: <s5hacc3n0j8.wl%tiwai@suse.de> (raw)
In-Reply-To: <20060306085817.GA32625@redhat.com>
At Mon, 6 Mar 2006 03:58:18 -0500,
Dave Jones wrote:
>
> Same again, snd_ctl_add() already kfree's on error.
>
> Coverity #956
> Signed-off-by: Dave Jones <davej@redhat.com>
>
> --- linux-2.6/sound/isa/ad1848/ad1848_lib.c~ 2006-03-06 03:57:22.000000000 -0500
> +++ linux-2.6/sound/isa/ad1848/ad1848_lib.c 2006-03-06 03:57:30.000000000 -0500
> @@ -1202,10 +1202,8 @@ int snd_ad1848_add_ctl(struct snd_ad1848
> strlcpy(ctl->id.name, name, sizeof(ctl->id.name));
> ctl->id.index = index;
> ctl->private_value = value;
> - if ((err = snd_ctl_add(chip->card, ctl)) < 0) {
> - snd_ctl_free_one(ctl);
> + if ((err = snd_ctl_add(chip->card, ctl)) < 0)
> return err;
> - }
> return 0;
> }
Yep, both fixes for sb_mixer.c and ad1848_lib.c are correct.
I also wanted to start fixing them since Andrew reported a similar bug
in core/control.c, but you are much faster :) Thanks!
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi
prev parent reply other threads:[~2006-03-06 13:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-06 8:58 Dave Jones
2006-03-06 13:52 ` Takashi Iwai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hacc3n0j8.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®