Skip to content

Commit

Permalink
ALSA: fm801: Fix double free in case of error in tuner detection
Browse files Browse the repository at this point in the history
Commit 9676001
("ALSA: fm801: add error handling if auto-detect fails") added
incorrect error handling.

Once we have successfully called snd_device_new(), the cleanup
function fm801_free() will automatically be called by snd_card_free()
and we must *not* also call fm801_free() directly.

Reported-by: Hor Jiun Shyong <jiunshyong@gmail.com>
References: http://bugs.debian.org/641946
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@kernel.org [v3.0+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Ben Hutchings authored and Takashi Iwai committed Sep 22, 2011
1 parent 46724c2 commit 2ba34e4
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions sound/pci/fm801.c
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,6 @@ static int __devinit snd_fm801_create(struct snd_card *card,
(tea575x_tuner & TUNER_TYPE_MASK) < 4) {
if (snd_tea575x_init(&chip->tea)) {
snd_printk(KERN_ERR "TEA575x radio not found\n");
snd_fm801_free(chip);
return -ENODEV;
}
} else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0) {
Expand All @@ -1251,7 +1250,6 @@ static int __devinit snd_fm801_create(struct snd_card *card,
}
if (tea575x_tuner == 4) {
snd_printk(KERN_ERR "TEA575x radio not found\n");
snd_fm801_free(chip);
return -ENODEV;
}
}
Expand Down

0 comments on commit 2ba34e4

Please sign in to comment.