mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Wahren <wahrenst@gmx.net>
To: "Kryštof Černý" <cleverline1mc@gmail.com>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Stefan Wahren" <stefan.wahren@chargebyte.com>
Cc: Ben Gardner <bgardner@wabtec.com>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v4 2/3] w1: ds2482: Add regulator support
Date: Wed, 27 Nov 2024 15:47:52 +0100	[thread overview]
Message-ID: <ef166c83-2fec-47dc-a3e8-215c211be0db@gmx.net> (raw)
In-Reply-To: <d83667b9-23a2-4f1c-9a9a-12ce1e3a3983@gmail.com>

Hi Kryštof,

Am 27.11.24 um 15:21 schrieb Kryštof Černý:
> 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.
I'm not the maintainer, but i suggests to send a V5 and add a separate
commit to avoid this issue. The merge window is still open.

Best regards
>
>> +
>>       data->client = client;
>>       i2c_set_clientdata(client, data);
>
> Best regards,
> Kryštof Černý


  reply	other threads:[~2024-11-27 14:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-25 22:47 [PATCH v4 0/3] Add support for attaching a regulator to w1: ds2482 Kryštof Černý via B4 Relay
2024-11-25 22:47 ` [PATCH v4 1/3] dt-bindings: w1: ds2482: Add vcc-supply property Kryštof Černý via B4 Relay
2024-11-25 22:47 ` [PATCH v4 2/3] w1: ds2482: Add regulator support Kryštof Černý via B4 Relay
2024-11-27 14:21   ` Kryštof Černý
2024-11-27 14:47     ` Stefan Wahren [this message]
2024-11-27 15:07     ` Krzysztof Kozlowski
2024-11-25 22:47 ` [PATCH v4 3/3] w1: ds2482: Fix datasheet URL Kryštof Černý via B4 Relay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ef166c83-2fec-47dc-a3e8-215c211be0db@gmx.net \
    --to=wahrenst@gmx.net \
    --cc=bgardner@wabtec.com \
    --cc=cleverline1mc@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=stefan.wahren@chargebyte.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®