Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firmware: stratix10-svc: fix wrong of_node_put() in init function

After finding a "firmware" dt node stratix10 tries to match it's
compatible string with it. To do so it's calling of_find_matching_node()
which already takes care of decreasing the refcount on the "firmware"
node. We are then incorrectly decreasing the refcount on that node
again.

This patch removes the unwarranted call to of_node_put().

Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver")
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Nicolas Saenz Julienne and committed by
Greg Kroah-Hartman
b5058483 8554e592

+1 -4
+1 -4
drivers/firmware/stratix10-svc.c
··· 1016 1016 return -ENODEV; 1017 1017 1018 1018 np = of_find_matching_node(fw_np, stratix10_svc_drv_match); 1019 - if (!np) { 1020 - of_node_put(fw_np); 1019 + if (!np) 1021 1020 return -ENODEV; 1022 - } 1023 1021 1024 1022 of_node_put(np); 1025 1023 ret = of_platform_populate(fw_np, stratix10_svc_drv_match, NULL, NULL); 1026 - of_node_put(fw_np); 1027 1024 if (ret) 1028 1025 return ret; 1029 1026