Re: [PATCH] soc: fsl: guts: Fix a resource leak in the error handling path of 'fsl_guts_probe()'

2021-10-22 Thread Tyrel Datwyler
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. >

Re: [PATCH] soc: fsl: guts: Fix a resource leak in the error handling path of 'fsl_guts_probe()'

2021-10-21 Thread Li Yang
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

[PATCH] soc: fsl: guts: Fix a resource leak in the error handling path of 'fsl_guts_probe()'

2021-08-18 Thread Christophe JAILLET
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