lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240706115229.47b8d7fa@jic23-huawei>
Date: Sat, 6 Jul 2024 11:52:29 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: Dan Robertson <dan@...obertson.com>, Lars-Peter Clausen
 <lars@...afoo.de>, Michael Hennerich <Michael.Hennerich@...log.com>,
 Nicolas Ferre <nicolas.ferre@...rochip.com>, Alexandre Belloni
 <alexandre.belloni@...tlin.com>, Claudiu Beznea <claudiu.beznea@...on.dev>,
 Oleksij Rempel <o.rempel@...gutronix.de>, kernel@...gutronix.de,
 linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, Sean Nyekjaer <sean@...nix.com>
Subject: Re: [PATCH 6/6] iio: adc: ad5755: drop redundant devm_kfree()

On Fri, 05 Jul 2024 12:40:49 +0200
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.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@...aro.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;
>  }
>  
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ