]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/cell: Add missing of_node_put()s in cbe_regs.c
authorLiang He <windhl@126.com>
Fri, 1 Jul 2022 14:49:48 +0000 (22:49 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 5 Sep 2022 07:28:26 +0000 (17:28 +1000)
commit725ae6bc1cccacce772d876ab0f316663e81b518
treee71e4b48ee87810281f983c6831740ce62b06915
parent260a73172af4785e8754ffa4131eff99c0645a92
powerpc/cell: Add missing of_node_put()s in cbe_regs.c

There are several bugs as following:

(1) In cbe_get_be_node(), hold the reference returned by of_find_xxx and
    of_get_xxx OF APIs and use it to call of_node_put().
(2) In cbe_fill_regs_map(), same as above.
(3) In cbe_regs_init(), during the iteration of for_each_node_by_type(),
    the refcount of 'cpu' will be automatically increased and decreased.
    However, there is a reference escaped out into 'map->cpu_node' and
    it should be properly handled.

Signed-off-by: Liang He <windhl@126.com>
[mpe: Drop references before pointer equality test in cbe_get_be_node()]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220701144949.252364-1-windhl@126.com
arch/powerpc/platforms/cell/cbe_regs.c