Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3de4414e authored by Dave Jones's avatar Dave Jones Committed by Jaroslav Kysela
Browse files

[ALSA] ad1848 double free



Modules: AD1848 driver

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

Coverity #956

Signed-off-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent bcc54f9a
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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;
}