Re: [PATCH 5/7] regulator: plug of_node leak in regulator_register()'s error path

From: Vladimir Zapolskiy
Date: Tue Aug 11 2020 - 02:15:26 EST


Hi Michał,

On 8/11/20 4:07 AM, Michał Mirosław wrote:
> By calling device_initialize() earlier and noting that kfree(NULL) is
> ok, we can save a bit of code in error handling and plug of_node leak.
> Fixed commit already did part of the work.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 9177514ce349 ("regulator: fix memory leak on error path of regulator_register()")
> Signed-off-by: Michał Mirosław <mirq-linux@xxxxxxxxxxxx>

thank you for the patch!

I was worried about a potentially remaining of_node reference leak,
but I was not able to reproduce it on practice without code fuzzing.

The change looks valid and it's a nice simplification.

Acked-by: Vladimir Zapolskiy <vz@xxxxxxxxx>

--
Best wishes,
Vladimir