[PATCH 1/2] ASoC: fsl_mqs: move of_node_put() to the correct location

Dan Carpenter error27 at gmail.com
Tue Apr 4 01:36:36 AEST 2023

On Mon, Apr 03, 2023 at 11:26:47PM +0800, Liliang Ye wrote:
> of_node_put() should have been done directly after
> mqs_priv->regmap = syscon_node_to_regmap(gpr_np);
> otherwise it creates a reference leak on the success path.
> To fix this, of_node_put() is moved to the correct location, and change
> all the gotos to direct returns.
> Fixes: a9d273671440 ("ASoC: fsl_mqs: Fix error handling in probe")
> Signed-off-by: Liliang Ye <yll at hust.edu.cn>
> Reviewed-by: Dan Carpenter <error27 at gmail.com>
> ---

These patches are from a university.  I think this patch was based on
manual review rather than static analysis.  They have not been tested
and this one affects the success path so that's always extra risky.

However I do believe the patch is correct and reviewed it before it was
sent publically.

dan carpenter

More information about the Linuxppc-dev mailing list