From: Greg Kroah-Hartman Date: Fri, 12 Feb 2010 21:56:48 +0000 (-0800) Subject: another .32 patch X-Git-Tag: v2.6.32.9~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=31c626ce64d0e4acf6a3ce1f0acbc4c525564f0d;p=thirdparty%2Fkernel%2Fstable-queue.git another .32 patch --- 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 index 00000000000..040cb68f953 --- /dev/null +++ b/queue-2.6.32/alsa-hda-use-warn_on_once-for-zero-division-detection.patch @@ -0,0 +1,38 @@ +From d6d8bf549393484e906913f02fa3c9518a2819b6 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Fri, 12 Feb 2010 18:17:06 +0100 +Subject: ALSA: hda - use WARN_ON_ONCE() for zero-division detection + +From: Takashi Iwai + +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 +Signed-off-by: Greg Kroah-Hartman + +--- + 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 */ diff --git a/queue-2.6.32/series b/queue-2.6.32/series index fc588c4f9b7..048bdd51c3a 100644 --- a/queue-2.6.32/series +++ b/queue-2.6.32/series @@ -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