mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-30 05:42:46 +01:00
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: 7e5bac610d ("clocksource/drivers/sun5i: Convert to platform device driver")
Signed-off-by: Chen Ni <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
Acked-by: Chen-Yu Tsai <[email protected]>
Link: https://patch.msgid.link/[email protected]
This commit is contained in:
1 parent
045a9dac7e
commit
fed9f727cc
1 file changed
+3
@@ -286,6 +286,9 @@ static int sun5i_timer_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
rstc = devm_reset_control_get_optional_exclusive(dev, NULL);
|
||||
if (IS_ERR(rstc))
|
||||
return dev_err_probe(dev, PTR_ERR(rstc),
|
||||
"failed to get reset\n");
|
||||
if (rstc)
|
||||
reset_control_deassert(rstc);
|
||||
|
||||
|
||||
Reference in new issue
Block a user