Skip to content

Commit

Permalink
[ALSA] ad1848 double free
Browse files Browse the repository at this point in the history
Modules: AD1848 driver

Same again, snd_ctl_add() already kfree's on error.

Coverity #956

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Dave Jones authored and Jaroslav Kysela committed Mar 22, 2006
1 parent bcc54f9 commit 3de4414
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sound/isa/ad1848/ad1848_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1202,10 +1202,8 @@ int snd_ad1848_add_ctl(struct snd_ad1848 *chip, const char *name, int index, int
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;
}

Expand Down

0 comments on commit 3de4414

Please sign in to comment.