[kernel] r18113 - in dists/sid/linux-2.6/debian: . patches/bugfix/all
Ben Hutchings
benh at alioth.debian.org
Thu Sep 22 13:53:44 UTC 2011
Author: benh
Date: Thu Sep 22 13:53:42 2011
New Revision: 18113
Log:
fm801: Fix regressions in 3.0 (Closes: #641946)
Added:
dists/sid/linux-2.6/debian/patches/bugfix/all/fm801-Fix-double-free-in-case-of-error-in-tuner-dete.patch
dists/sid/linux-2.6/debian/patches/bugfix/all/fm801-Gracefully-handle-failure-of-tuner-auto-detect.patch
Modified:
dists/sid/linux-2.6/debian/changelog
Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog Thu Sep 22 12:59:49 2011 (r18112)
+++ dists/sid/linux-2.6/debian/changelog Thu Sep 22 13:53:42 2011 (r18113)
@@ -2,6 +2,8 @@
[ Ben Hutchings ]
* Ignore ABI change in rt2800lib (fixes FTBFS on several architectures)
+ * fm801: Fix double free in case of error in tuner detection
+ * fm801: Gracefully handle failure of tuner auto-detect (Closes: #641946)
-- Ben Hutchings <ben at decadent.org.uk> Tue, 20 Sep 2011 23:50:35 +0100
Added: dists/sid/linux-2.6/debian/patches/bugfix/all/fm801-Fix-double-free-in-case-of-error-in-tuner-dete.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/fm801-Fix-double-free-in-case-of-error-in-tuner-dete.patch Thu Sep 22 13:53:42 2011 (r18113)
@@ -0,0 +1,44 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Mon, 19 Sep 2011 01:50:05 +0100
+Subject: [PATCH 1/2] fm801: Fix double free in case of error in tuner
+ detection
+
+commit 9676001559fce06e37c7dc230ab275f605556176
+("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 at gmail.com>
+References: http://bugs.debian.org/641946
+Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
+Cc: stable at kernel.org [v3.0+]
+---
+ sound/pci/fm801.c | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
+index a7ec703..0dd8963 100644
+--- a/sound/pci/fm801.c
++++ b/sound/pci/fm801.c
+@@ -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) {
+@@ -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;
+ }
+ }
+--
+1.7.5.4
+
Added: dists/sid/linux-2.6/debian/patches/bugfix/all/fm801-Gracefully-handle-failure-of-tuner-auto-detect.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/fm801-Gracefully-handle-failure-of-tuner-auto-detect.patch Thu Sep 22 13:53:42 2011 (r18113)
@@ -0,0 +1,62 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Mon, 19 Sep 2011 01:55:57 +0100
+Subject: [PATCH 2/2] fm801: Gracefully handle failure of tuner auto-detect
+
+commit 9676001559fce06e37c7dc230ab275f605556176
+("ALSA: fm801: add error handling if auto-detect fails") seems to
+break systems that were previously working without a tuner.
+
+As a bonus, this should fix init and cleanup for the case where the
+tuner is explicitly disabled.
+
+Reported-and-tested-by: Hor Jiun Shyong <jiunshyong at gmail.com>
+References: http://bugs.debian.org/641946
+Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
+Cc: stable at kernel.org [v3.0+]
+---
+ sound/pci/fm801.c | 13 ++++++++++---
+ 1 files changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
+index 0dd8963..ecce948 100644
+--- a/sound/pci/fm801.c
++++ b/sound/pci/fm801.c
+@@ -68,6 +68,7 @@ MODULE_PARM_DESC(enable, "Enable FM801 soundcard.");
+ module_param_array(tea575x_tuner, int, NULL, 0444);
+ MODULE_PARM_DESC(tea575x_tuner, "TEA575x tuner access method (0 = auto, 1 = SF256-PCS, 2=SF256-PCP, 3=SF64-PCR, 8=disable, +16=tuner-only).");
+
++#define TUNER_DISABLED (1<<3)
+ #define TUNER_ONLY (1<<4)
+ #define TUNER_TYPE_MASK (~TUNER_ONLY & 0xFFFF)
+
+@@ -1150,7 +1151,8 @@ static int snd_fm801_free(struct fm801 *chip)
+
+ __end_hw:
+ #ifdef CONFIG_SND_FM801_TEA575X_BOOL
+- snd_tea575x_exit(&chip->tea);
++ if (!(chip->tea575x_tuner & TUNER_DISABLED))
++ snd_tea575x_exit(&chip->tea);
+ #endif
+ if (chip->irq >= 0)
+ free_irq(chip->irq, chip);
+@@ -1250,10 +1252,15 @@ static int __devinit snd_fm801_create(struct snd_card *card,
+ }
+ if (tea575x_tuner == 4) {
+ snd_printk(KERN_ERR "TEA575x radio not found\n");
+- return -ENODEV;
++ chip->tea575x_tuner = TUNER_DISABLED;
+ }
+ }
+- strlcpy(chip->tea.card, snd_fm801_tea575x_gpios[(tea575x_tuner & TUNER_TYPE_MASK) - 1].name, sizeof(chip->tea.card));
++ if (!(chip->tea575x_tuner & TUNER_DISABLED)) {
++ strlcpy(chip->tea.card,
++ snd_fm801_tea575x_gpios[(tea575x_tuner &
++ TUNER_TYPE_MASK) - 1].name,
++ sizeof(chip->tea.card));
++ }
+ #endif
+
+ *rchip = chip;
+--
+1.7.5.4
+
More information about the Kernel-svn-changes
mailing list