From: Krzysztof Kozlowski <krzk@kernel.org>
To: 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 v5 2/4] w1: ds2482: switch to devm_kzalloc() from kzalloc()
Date: Fri, 29 Nov 2024 12:04:04 +0100 [thread overview]
Message-ID: <c0992fb1-20cd-4aab-847a-66542e9af7d2@kernel.org> (raw)
In-Reply-To: <20241129-ds2482-add-reg-v5-2-af8e83d41344@gmail.com>
On 29/11/2024 10:53, Kryštof Černý via B4 Relay wrote:
> /* Detect the 8-port version */
> @@ -505,21 +503,15 @@ static int ds2482_probe(struct i2c_client *client)
> err = w1_add_master_device(&data->w1_ch[idx].w1_bm);
> if (err) {
> data->w1_ch[idx].pdev = NULL;
> - goto exit_w1_remove;
> + for (idx = 0; idx < data->w1_count; idx++) {
> + if (data->w1_ch[idx].pdev != NULL)
> + w1_remove_master_device(&data->w1_ch[idx].w1_bm);
> + }
> + return err;
> }
> }
>
> return 0;
> -
> -exit_w1_remove:
> - for (idx = 0; idx < data->w1_count; idx++) {
> - if (data->w1_ch[idx].pdev != NULL)
> - w1_remove_master_device(&data->w1_ch[idx].w1_bm);
This exit path should stay.
> - }
> -exit_free:
> - kfree(data);
> -exit:
> - return err;
> }
>
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-11-29 11:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-29 9:53 [PATCH v5 0/4] Add support for attaching a regulator to w1: ds2482 Kryštof Černý via B4 Relay
2024-11-29 9:53 ` [PATCH v5 1/4] dt-bindings: w1: ds2482: Add vcc-supply property Kryštof Černý via B4 Relay
2024-11-29 9:53 ` [PATCH v5 2/4] w1: ds2482: switch to devm_kzalloc() from kzalloc() Kryštof Černý via B4 Relay
2024-11-29 11:04 ` Krzysztof Kozlowski [this message]
2024-11-29 9:53 ` [PATCH v5 3/4] w1: ds2482: Add regulator support Kryštof Černý via B4 Relay
2024-11-29 9:53 ` [PATCH v5 4/4] 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=c0992fb1-20cd-4aab-847a-66542e9af7d2@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®