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

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

[ALSA] fix usbmixer double kfree



Modules: USB generic driver

snd_ctl_add() kfree's the kcontrol already if we fail there,
so this driver is currently doing a double kfree.

Coverity bug #959

Signed-off-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 4fcf0117
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -434,7 +434,6 @@ static int add_control_to_empty(struct mixer_build *state, struct snd_kcontrol *
		kctl->id.index++;
		kctl->id.index++;
	if ((err = snd_ctl_add(state->chip->card, kctl)) < 0) {
	if ((err = snd_ctl_add(state->chip->card, kctl)) < 0) {
		snd_printd(KERN_ERR "cannot add control (err = %d)\n", err);
		snd_printd(KERN_ERR "cannot add control (err = %d)\n", err);
		snd_ctl_free_one(kctl);
		return err;
		return err;
	}
	}
	cval->elem_id = &kctl->id;
	cval->elem_id = &kctl->id;