From: Jonathan Cameron <jic23@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
Dan Robertson <dan@dlrobertson.com>,
Michael Hennerich <Michael.Hennerich@analog.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Claudiu Beznea <claudiu.beznea@tuxon.dev>,
Oleksij Rempel <o.rempel@pengutronix.de>,
Lars-Peter Clausen <lars@metafoo.de>,
kernel@pengutronix.de, Sean Nyekjaer <sean@geanix.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 6/6] iio: adc: ad5755: drop redundant devm_kfree()
Date: Sat, 6 Jul 2024 11:52:29 +0100 [thread overview]
Message-ID: <20240706115229.47b8d7fa@jic23-huawei> (raw)
In-Reply-To: <20240705-cleanup-h-iio-v1-6-77114c7e84c5@linaro.org>
On Fri, 05 Jul 2024 12:40:49 +0200
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> The driver calls ad5755_parse_fw() only from probe() function, so
> devm_kfree() during error path is not necessary and only makes code
> weirder.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
The path this is in doesn't result in the driver failing to probe as it
falls back to a const default structure.
So whilst it's not a 'bug' to remove this free, we are removing data the driver
is not going to use - so to my eye at least this is a deliberate design
decision.
Mind you it's not a particularly big allocation so maybe worth not cleaning
up until driver remove in order to save on complexity.
Sean, your code I think. Do you care either way?
Jonathan
> ---
> drivers/iio/dac/ad5755.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/iio/dac/ad5755.c b/drivers/iio/dac/ad5755.c
> index 0b24cb19ac9d..bfbfc3c1b6a5 100644
> --- a/drivers/iio/dac/ad5755.c
> +++ b/drivers/iio/dac/ad5755.c
> @@ -803,7 +803,6 @@ static struct ad5755_platform_data *ad5755_parse_fw(struct device *dev)
>
> error_out:
> fwnode_handle_put(pp);
> - devm_kfree(dev, pdata);
> return NULL;
> }
>
>
next prev parent reply other threads:[~2024-07-06 10:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-05 10:40 [PATCH 0/6] iio: adc: simplify with cleanup.h Krzysztof Kozlowski
2024-07-05 10:40 ` [PATCH 1/6] iio: accel: bma400: " Krzysztof Kozlowski
2024-07-05 10:40 ` [PATCH 2/6] iio: adc: ad7280a: " Krzysztof Kozlowski
2024-07-05 11:43 ` Nuno Sá
2024-07-05 10:40 ` [PATCH 3/6] iio: adc: at91: " Krzysztof Kozlowski
2024-07-05 10:40 ` [PATCH 4/6] iio: adc: max1363: " Krzysztof Kozlowski
2024-07-05 11:45 ` Nuno Sá
2024-07-05 10:40 ` [PATCH 5/6] iio: adc: ti-tsc2046: " Krzysztof Kozlowski
2024-07-06 5:08 ` Oleksij Rempel
2024-07-05 10:40 ` [PATCH 6/6] iio: adc: ad5755: drop redundant devm_kfree() Krzysztof Kozlowski
2024-07-05 11:47 ` Nuno Sá
2024-07-06 10:52 ` Jonathan Cameron [this message]
2024-07-07 11:34 ` Krzysztof Kozlowski
2024-07-06 10:55 ` [PATCH 0/6] iio: adc: simplify with cleanup.h Jonathan Cameron
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=20240706115229.47b8d7fa@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=dan@dlrobertson.com \
--cc=kernel@pengutronix.de \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=sean@geanix.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;
as well as URLs for NNTP newsgroup(s).