]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: adc: stm32-adc: harden against NULL pointer deref in stm32_adc_probe()
authorZhang Shurong <zhang_shurong@foxmail.com>
Sat, 15 Jul 2023 15:55:50 +0000 (23:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:07:01 +0000 (17:07 +0000)
commitb80aaff5f7817d50798ac61ed75973f004dd5202
tree324b5d89c427c5d294c2f41e3da6f00dcd363f5d
parentc92de3bf6ccf94f4b085366453d600e088b0e880
iio: adc: stm32-adc: harden against NULL pointer deref in stm32_adc_probe()

[ Upstream commit 3a23b384e7e3d64d5587ad10729a34d4f761517e ]

of_match_device() may fail and returns a NULL pointer.

In practice there is no known reasonable way to trigger this, but
in case one is added in future, harden the code by adding the check

Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Link: https://lore.kernel.org/r/tencent_994DA85912C937E3B5405BA960B31ED90A08@qq.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/adc/stm32-adc-core.c