ASoC: cx2072x: fix integer overflow on unsigned int multiply
authorColin Ian King <colin.king@canonical.com>
Fri, 24 May 2019 22:25:51 +0000 (23:25 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 28 May 2019 14:53:17 +0000 (15:53 +0100)
commitbe0461048b60066eaba9046178fb96e78579af21
tree0dd85ab05276d1e27311df538d759e9a77c2d80d
parenteb5b12843b067d685a8d7a191b928b07934b2d02
ASoC: cx2072x: fix integer overflow on unsigned int multiply

In the case where frac_div larger than 96 the result of an unsigned
multiplication overflows an unsigned int.  For example, this can
happen when the sample_rate is 192000 and pll_input is 122.  Fix
this by casing the first term of the mutiply to a u64. Also remove
the extraneous parentheses around the expression.

Addresses-Coverity: ("Unintentional integer overflow")
Fixes: a497a4363706 ("ASoC: Add support for Conexant CX2072X CODEC")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cx2072x.c