From: Krzysztof Kozlowski <krzk@kernel.org>
To: "Kryštof Černý" <cleverline1mc@gmail.com>,
"Rob Herring" <robh@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Stefan Wahren" <stefan.wahren@chargebyte.com>,
"Stefan Wahren" <wahrenst@gmx.net>
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 16:07:17 +0100 [thread overview]
Message-ID: <dafc72c0-3d9a-4f41-b5bf-5e467be04447@kernel.org> (raw)
In-Reply-To: <d83667b9-23a2-4f1c-9a9a-12ce1e3a3983@gmail.com>
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
next prev parent reply other threads:[~2024-11-27 15:07 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
2024-11-27 15:07 ` Krzysztof Kozlowski [this message]
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=dafc72c0-3d9a-4f41-b5bf-5e467be04447@kernel.org \
--to=krzk@kernel.org \
--cc=bgardner@wabtec.com \
--cc=cleverline1mc@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=stefan.wahren@chargebyte.com \
--cc=wahrenst@gmx.net \
/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®