]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
another .32 patch
authorGreg Kroah-Hartman <gregkh@suse.de>
Fri, 12 Feb 2010 21:56:48 +0000 (13:56 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 12 Feb 2010 21:56:48 +0000 (13:56 -0800)
queue-2.6.32/alsa-hda-use-warn_on_once-for-zero-division-detection.patch [new file with mode: 0644]
queue-2.6.32/series

diff --git a/queue-2.6.32/alsa-hda-use-warn_on_once-for-zero-division-detection.patch b/queue-2.6.32/alsa-hda-use-warn_on_once-for-zero-division-detection.patch
new file mode 100644 (file)
index 0000000..040cb68
--- /dev/null
@@ -0,0 +1,38 @@
+From d6d8bf549393484e906913f02fa3c9518a2819b6 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Fri, 12 Feb 2010 18:17:06 +0100
+Subject: ALSA: hda - use WARN_ON_ONCE() for zero-division detection
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit d6d8bf549393484e906913f02fa3c9518a2819b6 upstream.
+
+Replace the zero-division warning message with WARN_ON_ONCE() per the
+advice by Linus.  This shouldn't happen, but if it happens, it's
+possible that the bug happens often due to buggy IRQs.
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/hda/hda_intel.c |    9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
+
+--- a/sound/pci/hda/hda_intel.c
++++ b/sound/pci/hda/hda_intel.c
+@@ -1858,12 +1858,9 @@ static int azx_position_ok(struct azx *c
+       if (!bdl_pos_adj[chip->dev_index])
+               return 1; /* no delayed ack */
+-      if (azx_dev->period_bytes == 0) {
+-              printk(KERN_WARNING
+-                     "hda-intel: Divide by zero was avoided "
+-                     "in azx_dev->period_bytes.\n");
+-              return 0;
+-      }
++      if (WARN_ONCE(!azx_dev->period_bytes,
++                    "hda-intel: zero azx_dev->period_bytes"))
++              return 0; /* this shouldn't happen! */
+       if (pos % azx_dev->period_bytes > azx_dev->period_bytes / 2)
+               return 0; /* NG - it's below the period boundary */
+       return 1; /* OK, it's fine */
index fc588c4f9b7a3d2e53e809367c6b2c99c5305258..048bdd51c3a095e9dd2d89b6d41bfe85c1a627df 100644 (file)
@@ -61,3 +61,4 @@ devmem-check-vmalloc-address-on-kmem-read-write.patch
 devmem-fix-kmem-write-bug-on-memory-holes.patch
 scsi-mptfusion-mptscsih_abort-return-value-should-be-success-instead-of-value-0.patch
 sh-couple-kernel-and-user-write-page-perm-bits-for-config_x2tlb.patch
+alsa-hda-use-warn_on_once-for-zero-division-detection.patch