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

2020-08-13 Thread Vladimir Zapolskiy
On 8/12/20 5:09 PM, Michał Mirosław wrote: > On Wed, Aug 12, 2020 at 09:29:12AM +0300, Vladimir Zapolskiy wrote: >> On 8/12/20 4:31 AM, Michał Mirosław wrote: > [...] >>> config = kmemdup(cfg, sizeof(*cfg), GFP_KERNEL); >>> if (config == NULL) { >>> - kfree(rdev); >>>

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

2020-08-12 Thread Michał Mirosław
On Wed, Aug 12, 2020 at 09:29:12AM +0300, Vladimir Zapolskiy wrote: > On 8/12/20 4:31 AM, Michał Mirosław wrote: [...] > > config = kmemdup(cfg, sizeof(*cfg), GFP_KERNEL); > > if (config == NULL) { > > - kfree(rdev); > > ret = -ENOMEM; > > - goto rinse; > > +

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

2020-08-11 Thread Vladimir Zapolskiy
Hi Michał, On 8/12/20 4:31 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: sta...@vger.kernel.org > Fixes: 9177514ce349

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

2020-08-11 Thread Michał Mirosław
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: sta...@vger.kernel.org Fixes: 9177514ce349 ("regulator: fix memory leak on error path of regulator_register()