[PATCH 3/9] [UBUNTU:sound/isa/ad1848] Fix double-free in AD1848 driver

crimsun at fungus.sh.nu crimsun at fungus.sh.nu
Tue Mar 28 08:17:26 UTC 2006


Subject: [PATCH 3/9] [UBUNTU:sound/isa/ad1848] Fix double-free in AD1848 driver

UpstreamStatus: Applied, http://kernel.org/git/?p=linux/kernel/git/perex/alsa-current.git;a=commitdiff;h=3de4414e798795ef5d719622dbf12bbe27a9e72e

Another bug fix for Coverity #956:
sound/isa/ad1848/ad1848_lib.c::snd_ad1848_add_ctl() attempts to kfree()
what has been freed already on error. Patch from Dave Jones.

Signed-off-by: Daniel T Chen <crimsun at ubuntu.com>

---

 sound/isa/ad1848/ad1848_lib.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

957c5a292edce021ee0610311d2733e0419506bf
diff --git a/sound/isa/ad1848/ad1848_lib.c b/sound/isa/ad1848/ad1848_lib.c
index 891bacc..bf2ec3e 100644
--- a/sound/isa/ad1848/ad1848_lib.c
+++ b/sound/isa/ad1848/ad1848_lib.c
@@ -1206,10 +1206,8 @@ int snd_ad1848_add_ctl(ad1848_t *chip, c
 	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;
 }
 
-- 
1.1.3


-- 
Daniel T. Chen            crimsun at ubuntu.com
GPG key:   www.sh.nu/~crimsun/pubkey.gpg.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20060328/8d9727dd/attachment.sig>


More information about the kernel-team mailing list