From 9b59588d8be91c96bfb0371e912ceb4f16315dbf Mon Sep 17 00:00:00 2001 From: Miaoqian Lin Date: Mon, 16 May 2022 11:20:10 +0400 Subject: soc: rockchip: Fix refcount leak in rockchip_grf_init of_find_matching_node_and_match returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 4c58063d4258 ("soc: rockchip: add driver handling grf setup") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220516072013.19731-1-linmq006@gmail.com Signed-off-by: Heiko Stuebner --- drivers/soc/rockchip/grf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/soc') diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c index 384461b70684..15a3970e3509 100644 --- a/drivers/soc/rockchip/grf.c +++ b/drivers/soc/rockchip/grf.c @@ -165,12 +165,14 @@ static int __init rockchip_grf_init(void) return -ENODEV; if (!match || !match->data) { pr_err("%s: missing grf data\n", __func__); + of_node_put(np); return -EINVAL; } grf_info = match->data; grf = syscon_node_to_regmap(np); + of_node_put(np); if (IS_ERR(grf)) { pr_err("%s: could not get grf syscon\n", __func__); return PTR_ERR(grf); -- cgit v1.2.3 From 526f3f3b102f05e97d5e51fb0dcf5037c7be9722 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 23 May 2022 10:55:20 +0200 Subject: soc: ixp4xx/qmgr: Fix unused match warning The kernel test robot found this inconsistency: >> drivers/soc/ixp4xx/ixp4xx-npe.c:737:34: warning: 'ixp4xx_npe_of_match' defined but not used [-Wunused-const-variable=] 737 | static const struct of_device_id ixp4xx_npe_of_match[] = { This is because the match is enclosed in the of_match_ptr() which compiles into NULL when OF is disabled and this is unnecessary. Fix it by dropping of_match_ptr() around the match. Reported-by: kernel test robot Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220523085520.913217-1-linus.walleij@linaro.org' Signed-off-by: Arnd Bergmann --- drivers/soc/ixp4xx/ixp4xx-qmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/soc') diff --git a/drivers/soc/ixp4xx/ixp4xx-qmgr.c b/drivers/soc/ixp4xx/ixp4xx-qmgr.c index 9154c7029b05..291086bb9313 100644 --- a/drivers/soc/ixp4xx/ixp4xx-qmgr.c +++ b/drivers/soc/ixp4xx/ixp4xx-qmgr.c @@ -459,7 +459,7 @@ static const struct of_device_id ixp4xx_qmgr_of_match[] = { static struct platform_driver ixp4xx_qmgr_driver = { .driver = { .name = "ixp4xx-qmgr", - .of_match_table = of_match_ptr(ixp4xx_qmgr_of_match), + .of_match_table = ixp4xx_qmgr_of_match, }, .probe = ixp4xx_qmgr_probe, .remove = ixp4xx_qmgr_remove, -- cgit v1.2.3