diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-10-16 14:26:32 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-11-16 09:30:21 -0800 |
commit | 4bf6e92a4198394e7ca349f263d7e5be1e472e55 (patch) | |
tree | 1f55e2fce4178446cfb1e1636be998d2fe4dd2ef /sound | |
parent | 33dcd320e1ef1b90eef626eae351b41e0ad6b798 (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')
-rw-r--r-- | sound/pci/rme9652/hdsp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index 3b3ef657f73..75dcb9acee9 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 |