Messages in this thread Patch in this message |  | | From | cgel.zte@gmail ... | Subject | [PATCH] x86/devicetree: Fix refcount leak in dtb_lapic_setup | Date | Sat, 2 Apr 2022 08:46:36 +0000 |
| |
From: Lv Ruyi <lv.ruyi@zte.com.cn>
If dn is true that meas the of_find_compatible_node function successfully returns a node pointer with refcount incremented, use of_node_put() on it when done.
Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn> --- arch/x86/kernel/devicetree.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c index 5cd51f25f446..6498825cf48d 100644 --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c @@ -156,6 +156,7 @@ static void __init dtb_lapic_setup(void) dn = of_find_compatible_node(NULL, NULL, "intel,ce4100-lapic"); if (dn) { ret = of_address_to_resource(dn, 0, &r); + of_node_put(dn); if (WARN_ON(ret)) return; lapic_addr = r.start; -- 2.25.1
|  |