Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ba28dfa authored by Venkata Narendra Kumar Gutta's avatar Venkata Narendra Kumar Gutta Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: soc-core: Fix integer overflow



Integer overflow observed in the function to get the values of
mixer controls. Update type of mask from int to unsigned int
and do explicit type casting to fix the issue.

CRs-Fixed: 981735
Change-Id: I8fd40aa75b2d79f116df6b5e7508548f0c938343
Signed-off-by: default avatarVenkata Narendra Kumar Gutta <vgutta@codeaurora.org>
parent 2f2a03e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2740,7 +2740,7 @@ int snd_soc_get_volsw_sx(struct snd_kcontrol *kcontrol,
	unsigned int rshift = mc->rshift;
	int max = mc->max;
	int min = mc->min;
	int mask = (1 << (fls(min + max) - 1)) - 1;
	unsigned int mask = (unsigned int)(1 << (fls(min + max) - 1)) - 1;
	unsigned int val;
	int ret;