]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc: rockchip: grf: Add missing of_node_put() when returning
authorShawn Lin <shawn.lin@rock-chips.com>
Wed, 11 Feb 2026 13:02:37 +0000 (21:02 +0800)
committerHeiko Stuebner <heiko@sntech.de>
Sun, 22 Feb 2026 22:27:20 +0000 (23:27 +0100)
Fix the smatch checking:
drivers/soc/rockchip/grf.c:249 rockchip_grf_init()
warn: inconsistent refcounting 'np->kobj.kref.refcount.refs.counter':

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Fixes: 75fb63ae0312 ("soc: rockchip: grf: Support multiple grf to be handled")
Closes: https://lore.kernel.org/all/aYXvgTcUJWQL2can@stanley.mountain/
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Link: https://patch.msgid.link/1770814957-17762-1-git-send-email-shawn.lin@rock-chips.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
drivers/soc/rockchip/grf.c

index 04937c40da471e7b414a171b442a6201e784e70c..b459607c118aa029641bf051961262b2859b7b55 100644 (file)
@@ -231,6 +231,7 @@ static int __init rockchip_grf_init(void)
                grf = syscon_node_to_regmap(np);
                if (IS_ERR(grf)) {
                        pr_err("%s: could not get grf syscon\n", __func__);
+                       of_node_put(np);
                        return PTR_ERR(grf);
                }