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: <ad3af033-97f1-3aad-d082-c6ed56185b59@metafoo.de>
Date:   Thu, 2 Jun 2022 13:53:53 +0200
From:   Lars-Peter Clausen <lars@...afoo.de>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
        linux-iio@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-amlogic@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc:     Jonathan Cameron <jic23@...nel.org>,
        Neil Armstrong <narmstrong@...libre.com>,
        Kevin Hilman <khilman@...libre.com>,
        Jerome Brunet <jbrunet@...libre.com>
Subject: Re: [PATCH v2 3/3] iio: adc: meson_saradc: Use temporary variable for
 struct device

On 6/2/22 13:42, Andy Shevchenko wrote:
return -ENOMEM;
>   
> @@ -690,7 +687,7 @@ static int meson_sar_adc_clk_init(struct iio_dev *indio_dev,
>   	priv->clk_gate.bit_idx = __ffs(MESON_SAR_ADC_REG3_CLK_EN);
>   	priv->clk_gate.hw.init = &init;
>   
> -	priv->adc_clk = devm_clk_register(&indio_dev->dev, &priv->clk_gate.hw);
> +	priv->adc_clk = devm_clk_register(idev, &priv->clk_gate.hw);

You are not changing anything here. But we shouldn't be devm'ing on the 
IIO device. It will get freed eventually, but only when the last 
reference to the iio device has been dropped, which might be long after 
the platform device has been removed. devm'ing should happen on the 
platform_device's device. Might be worth fixing.

>   	if (WARN_ON(IS_ERR(priv->adc_clk)))
>   		return PTR_ERR(priv->adc_clk);
>   
> @@ -706,8 +703,7 @@ static int meson_sar_adc_temp_sensor_init(struct iio_dev *indio_dev)
>   	size_t read_len;
>   	

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ