Re: drivers/soundwire/qcom.c:1269 qcom_swrm_get_port_config() error: buffer overflow 'ctrl->pconfig' 14 <= 14

From: Krzysztof Kozlowski
Date: Thu Jun 01 2023 - 04:58:10 EST


On 20/05/2023 10:35, Dan Carpenter wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: d635f6cc934bcd467c5d67148ece74632fd96abf
> commit: 2367e0ecb498764e95cfda691ff0828f7d25f9a4 soundwire: qcom: gracefully handle too many ports in DT
> config: ia64-randconfig-m041-20230514
> compiler: ia64-linux-gcc (GCC) 12.1.0
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Reported-by: Dan Carpenter <error27@xxxxxxxxx>
> | Closes: https://lore.kernel.org/r/202305201301.sCJ8UDKV-lkp@xxxxxxxxx/
>
> New smatch warnings:
> drivers/soundwire/qcom.c:1269 qcom_swrm_get_port_config() error: buffer

Thanks, I'll fix it. issue was present in original code, my commit just
made it obvious :)

Best regards,
Krzysztof