]> git.baikalelectronics.ru Git - kernel.git/commit
net: sparx5: Fix initialization of variables on stack
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Fri, 4 Mar 2022 14:09:18 +0000 (15:09 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 5 Mar 2022 04:57:57 +0000 (20:57 -0800)
commit07b1478732c9bfdf297f3102cb59ef60ed00fdf5
tree7f3df7d0f8dca2840224ab7f203c8a0351928186
parent408faf61dcec21401735891cff8a3c5e505a7a47
net: sparx5: Fix initialization of variables on stack

The variables 'res' inside the functions sparx5_ptp_get_1ppm and
sparx5_ptp_get_nominal_value was not initialized. So in case of the default
case of the switch after, it would return an uninitialized variable.
This makes also the clang builds to failed.

Fixes: 9d05b8cb378c34 ("net: sparx5: Add support for ptp clocks")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Link: https://lore.kernel.org/r/20220304140918.3356873-1-horatiu.vultur@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c