On 10/21/21 5:26 PM, Li Yang wrote:
> On Wed, Aug 18, 2021 at 4:23 PM Christophe JAILLET
> wrote:
>>
>> If an error occurs after 'of_find_node_by_path()', the reference taken for
>> 'root' will never be released and some memory will leak.
>
> Thanks for finding this. This truly is a problem.
>
On Wed, Aug 18, 2021 at 4:23 PM Christophe JAILLET
wrote:
>
> If an error occurs after 'of_find_node_by_path()', the reference taken for
> 'root' will never be released and some memory will leak.
Thanks for finding this. This truly is a problem.
>
> Instead of adding an error handling path and
If an error occurs after 'of_find_node_by_path()', the reference taken for
'root' will never be released and some memory will leak.
Instead of adding an error handling path and modifying all the
'return -SOMETHING' into 'goto errorpath', use 'devm_add_action_or_reset()'
to release the reference