[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dafc72c0-3d9a-4f41-b5bf-5e467be04447@kernel.org>
Date: Wed, 27 Nov 2024 16:07:17 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Kryštof Černý <cleverline1mc@...il.com>,
Rob Herring <robh@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Stefan Wahren <stefan.wahren@...rgebyte.com>,
Stefan Wahren <wahrenst@....net>
Cc: Ben Gardner <bgardner@...tec.com>, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org
Subject: Re: [PATCH v4 2/3] w1: ds2482: Add regulator support
On 27/11/2024 15:21, Kryštof Černý wrote:
> I2C_FUNC_SMBUS_WRITE_BYTE_DATA |
>> @@ -457,6 +459,10 @@ static int ds2482_probe(struct i2c_client *client)
>> goto exit;
>> }
>>
>> + ret = devm_regulator_get_enable(&client->dev, "vcc");
>> + if (ret)
>> + return dev_err_probe(&client->dev, ret, "Failed to enable regulator\n");
>
> This will cause a memory leak of `data`, I would refactor the driver a
> bit in the next patch revision. Should I create a separate commit that
> switches from kzalloc() to devm_kzalloc() or keep it in patch 2/3? The
> separate commits way seems correct to me, so it is clearly
> distinguished. Sorry that I missed it.
Separate commit, please.
Best regards,
Krzysztof
Powered by blists - more mailing lists