From: Takashi Iwai Date: Tue, 16 Oct 2007 12:26:32 +0000 (+0200) Subject: ALSA: hdsp - Fix zero division X-Git-Tag: v2.6.23.6~28 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4bf6e92a4198394e7ca349f263d7e5be1e472e55;p=karo-tx-linux.git ALSA: hdsp - Fix zero division patch 2a3988f6d2c5be9d02463097775d1c66a8290527 in mainline. Fix zero-division bug in the calculation dds offset. Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela Cc: Maarten Bressers Cc: gentoo kernel Signed-off-by: Greg Kroah-Hartman --- 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