summaryrefslogtreecommitdiff
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-10-16 14:26:32 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2007-11-21 09:25:54 -0800
commit51303d2171ec5bdf448f820ccec0224e854e61df (patch)
treeed135a21bc63415697c19a5eeb974301f4df435b /sound/pci
parent6c7ad737a3134d1b778bf60e7e4b323d662dfadd (diff)
ALSA: hdsp - Fix zero division
patch 2a3988f6d2c5be9d02463097775d1c66a8290527 in mainline. Fix zero-division bug in the calculation dds offset. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz> Cc: Maarten Bressers <mbressers@gmail.com> Cc: gentoo kernel <kernel@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/rme9652/hdsp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index 3b3ef657f73e..75dcb9acee99 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -3108,6 +3108,9 @@ static int hdsp_dds_offset(struct hdsp *hdsp)
unsigned int dds_value = hdsp->dds_value;
int system_sample_rate = hdsp->system_sample_rate;
+ if (!dds_value)
+ return 0;
+
n = DDS_NUMERATOR;
/*
* dds_value = n / rate