Re: [alsa-devel] [PATCH] ASoC: Fix UBSAN warning at snd_soc_get/put_volsw_sx()

2018-09-11 Thread Rohit Kumar
Thanks Takashi for reviewing. On 9/10/2018 11:56 PM, Takashi Iwai wrote: On Mon, 10 Sep 2018 19:33:56 +0200, Rohit kumar wrote: In functions snd_soc_get_volsw_sx() or snd_soc_put_volsw_sx(), if the result of (min + max) is negative, then fls() returns signed integer with value as 32. This lead

Re: [PATCH] ASoC: Fix UBSAN warning at snd_soc_get/put_volsw_sx()

2018-09-10 Thread Takashi Iwai
On Mon, 10 Sep 2018 19:33:56 +0200, Rohit kumar wrote: > > In functions snd_soc_get_volsw_sx() or snd_soc_put_volsw_sx(), > if the result of (min + max) is negative, then fls() returns > signed integer with value as 32. This leads to signed integer > overflow as complete operation is considered as

[PATCH] ASoC: Fix UBSAN warning at snd_soc_get/put_volsw_sx()

2018-09-10 Thread Rohit kumar
In functions snd_soc_get_volsw_sx() or snd_soc_put_volsw_sx(), if the result of (min + max) is negative, then fls() returns signed integer with value as 32. This leads to signed integer overflow as complete operation is considered as signed integer. UBSAN: Undefined behaviour in sound/soc/soc-ops.