Re: [PATCH] powerpc: powernv: Fix refcount leak bug in opal-powercap

2022-06-18 Thread Christophe JAILLET
Le 17/06/2022 à 07:42, Liang He a écrit : At 2022-06-17 13:01:27, "Christophe JAILLET" wrote: Le 17/06/2022 à 06:20, Liang He a écrit : In opal_powercap_init(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() in fail path or when

Re:Re: [PATCH] powerpc: powernv: Fix refcount leak bug in opal-powercap

2022-06-17 Thread Liang He
At 2022-06-17 13:01:27, "Christophe JAILLET" wrote: >Le 17/06/2022 à 06:20, Liang He a écrit : >> In opal_powercap_init(), of_find_compatible_node() will return >> a node pointer with refcount incremented. We should use of_node_put() >> in fail path or when it is not used anymore. >> >> Besid

Re:Re: [PATCH] powerpc: powernv: Fix refcount leak bug in opal-powercap

2022-06-16 Thread Liang He
At 2022-06-17 13:01:27, "Christophe JAILLET" wrote: >Le 17/06/2022 à 06:20, Liang He a écrit : >> In opal_powercap_init(), of_find_compatible_node() will return >> a node pointer with refcount incremented. We should use of_node_put() >> in fail path or when it is not used anymore. >> >> Besid

Re: [PATCH] powerpc: powernv: Fix refcount leak bug in opal-powercap

2022-06-16 Thread Christophe JAILLET
Le 17/06/2022 à 06:20, Liang He a écrit : In opal_powercap_init(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() in fail path or when it is not used anymore. Besides, for_each_child_of_node() will automatically *inc* and *dec* refcoun

[PATCH] powerpc: powernv: Fix refcount leak bug in opal-powercap

2022-06-16 Thread Liang He
In opal_powercap_init(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() in fail path or when it is not used anymore. Besides, for_each_child_of_node() will automatically *inc* and *dec* refcount during iteration. However, we should add t