aboutsummaryrefslogtreecommitdiff
path: root/net/lapb/lapb_out.c
diff options
context:
space:
mode:
authorConor Dooley <[email protected]>2022-06-15 15:20:29 +0100
committerMark Brown <[email protected]>2022-06-16 09:31:21 +0100
commit2081ad1467469b649fc9f9226b235977a7bf9402 (patch)
tree07a4933bfb37884217da5741e8938b865365b79a /net/lapb/lapb_out.c
parentd52b095b6cb4dca3bdbc144e7098abdbbd45e9bc (diff)
spi: microchip-core: fix passing zero to PTR_ERR warning
It is possible that the error case for devm_clk_get() returns NULL, in which case zero will be passed to PTR_ERR() as shown by the Smatch static checker warning: drivers/spi/spi-microchip-core.c:557 mchp_corespi_probe() warn: passing zero to 'PTR_ERR' Remove the NULL check and carry on with a dummy clock in case of an error. To avoid a potential div zero, abort calculating clkgen if clk_get_rate(spi->clk) is zero. Fixes: 9ac8d17694b6 ("spi: add support for microchip fpga spi controllers") Reported-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/linux-spi/20220615091633.GI2168@kadam/ Signed-off-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'net/lapb/lapb_out.c')
0 files changed, 0 insertions, 0 deletions