Commit 2611f484 authored by Zhang Shurong's avatar Zhang Shurong Committed by Cai Xinchen
Browse files

iio: adc: stm32-adc: harden against NULL pointer deref in stm32_adc_probe()

mainline inclusion
from mainline-v6.7-rc1
commit 3a23b384e7e3d64d5587ad10729a34d4f761517e
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9REBR
CVE: CVE-2023-52802
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=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: default avatarZhang Shurong <zhang_shurong@foxmail.com>
Link: https://lore.kernel.org/r/tencent_994DA85912C937E3B5405BA960B31ED90A08@qq.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Conflicts:
	drivers/iio/adc/stm32-adc-core.c
[Only context conflicts]
Signed-off-by: default avatarCai Xinchen <caixinchen1@huawei.com>
parent 03933bd1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment