]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
clocksource/drivers/sun5i: Handle error returns from devm_reset_control_get_optional_...
authorChen Ni <nichen@iscas.ac.cn>
Thu, 5 Feb 2026 08:40:37 +0000 (16:40 +0800)
committerDaniel Lezcano <daniel.lezcano@kernel.org>
Tue, 24 Mar 2026 17:30:44 +0000 (18:30 +0100)
commitfed9f727cc3f91dde8278961269419083502b40e
treeda624c27201369c4266c654f9d0e3afbfaf1f42e
parent045a9dac7eb74ce07160d7715b6629c83f3d92c0
clocksource/drivers/sun5i: Handle error returns from devm_reset_control_get_optional_exclusive()

The devm_reset_control_get_optional_exclusive() function may return an
ERR_PTR in case of genuine reset control acquisition errors, not just
NULL which indicates the legitimate absence of an optional reset.

Add an IS_ERR() check after the call in sun5i_timer_probe(). On error,
return the error code to ensure proper failure handling rather than
proceeding with invalid pointers.

Fixes: 7e5bac610d2f ("clocksource/drivers/sun5i: Convert to platform device driver")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Acked-by: Chen-Yu Tsai <wens@kernel.org>
Link: https://patch.msgid.link/20260205084037.3661261-1-nichen@iscas.ac.cn
drivers/clocksource/timer-sun5i.c