mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 18:00:53 +07:00
[ALSA] ad1848 double free
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>
This commit is contained in:
parent
bcc54f9a56
commit
3de4414e79
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user