ALSA: hdsp - Fix zero division
patch 2a3988f6d2 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
33dcd320e1
commit
4bf6e92a41
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user