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] [day] [month] [year] [list]
Date:   Sat, 23 Nov 2019 16:29:21 +0000
From:   Jonathan Cameron <jic23@...nel.org>
To:     Chuhong Yuan <hslester96@...il.com>
Cc:     Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>,
        linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: adc: max1027: fix not unregistered iio trigger

On Mon, 18 Nov 2019 19:40:18 +0800
Chuhong Yuan <hslester96@...il.com> wrote:

> The driver forgets to unregister the iio trigger in probe failure and
> remove.
> Use devm API to fix it.
> 
> Signed-off-by: Chuhong Yuan <hslester96@...il.com>
Hi.

This has crossed with some other patches to the driver, but the fix
is still applicable.  If we want to push this back to older stable
branches we will need to do manual backports.

Adjusted version applied to the fixes-togreg branch of iio.git.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/max1027.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
> index 214883458582..8caead7dffa5 100644
> --- a/drivers/iio/adc/max1027.c
> +++ b/drivers/iio/adc/max1027.c
> @@ -446,7 +446,12 @@ static int max1027_probe(struct spi_device *spi)
>  	st->trig->ops = &max1027_trigger_ops;
>  	st->trig->dev.parent = &spi->dev;
>  	iio_trigger_set_drvdata(st->trig, indio_dev);
> -	iio_trigger_register(st->trig);
> +
> +	ret = devm_iio_trigger_register(&spi->dev, st->trig);
> +	if (ret < 0) {
> +		dev_err(&indio_dev->dev, "Failed to register iio trigger\n");
> +		return ret;
> +	}
>  
>  	ret = devm_request_threaded_irq(&spi->dev, spi->irq,
>  					iio_trigger_generic_data_rdy_poll,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ