lkml.org 
[lkml]   [2018]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] power: supply: ltc2941-battery-gauge: Release device_node in ltc294x_i2c_probe()
From
Date

Hi,

On 01.05.2018 15:39, Sebastian Reichel wrote:
> Hi,
>
> On Sun, Apr 29, 2018 at 01:35:55AM +0300, Alexey Khoroshilov wrote:
>> There is of_node_get(client->dev.of_node) in ltc294x_i2c_probe(),
>> but these is no of_node_put() somethere in the driver.
>>
>> The patch adds one on error and normal paths.
>>
>> Found by Linux Driver Verification project (linuxtesting.org).
>>
>> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
>
> That is ugly. Let's replace of_property_read_u32(np, ...) with
> device_property_read_u32(dev, ...) and get rid of np instead.
>

Ok, I will prepare v2.

What is the right way to replace
info->supply_desc.name = np->name;
?

If lifetime of 'client->dev.of_node' = 'np' cannot be less than lifetime
of 'client->dev', should we use just
info->supply_desc.name = client->dev.of_node->name;
?

Thank you,
Alexey

\
 
 \ /
  Last update: 2018-05-08 21:17    [W:0.075 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site