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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <053af1f0-546e-416b-b8bc-22837e908ae0@wanadoo.fr>
Date: Sun, 22 Sep 2024 15:32:44 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Linus Walleij <linus.walleij@...aro.org>,
 Sebastien Bourdelin <sebastien.bourdelin@...oirfairelinux.com>,
 Arnd Bergmann <arnd@...db.de>,
 Uwe Kleine-König <u.kleine-koenig@...libre.com>,
 Sean Young <sean@...s.org>
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] bus: ts-nbus: Fix an error handling path in
 ts_nbus_probe()

Le 16/03/2024 à 17:31, Christophe JAILLET a écrit :
> If of_platform_populate() fails, we must shutdown the FPGA, as already done
> in the remove function.
> 
> Fixes: 5b143d2a6ede ("bus: add driver for the Technologic Systems NBUS")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> Compile tested only.
> 
> This patch is speculative and based on the output of one of my scripts that
> tries to spot calls in .remove function that are not also in the error
> handling path of the probe. I'm not familiar with the pwm_ API.
> 
> I don't think that the locking in the remove function is needed here.
> 
> Review with care.
> ---
>   drivers/bus/ts-nbus.c | 12 +++++++++---
>   1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/bus/ts-nbus.c b/drivers/bus/ts-nbus.c
> index baf22a82c47a..fa1bb9b78446 100644
> --- a/drivers/bus/ts-nbus.c
> +++ b/drivers/bus/ts-nbus.c
> @@ -309,13 +309,19 @@ static int ts_nbus_probe(struct platform_device *pdev)
>   	dev_set_drvdata(dev, ts_nbus);
>   
>   	ret = of_platform_populate(dev->of_node, NULL, NULL, dev);
> -	if (ret < 0)
> -		return dev_err_probe(dev, ret,
> -				     "failed to populate platform devices on bus\n");
> +	if (ret < 0) {
> +		dev_err_probe(dev, ret,
> +			      "failed to populate platform devices on bus\n");
> +		goto err_disable_pwm;
> +	}
>   
>   	dev_info(dev, "initialized\n");
>   
>   	return 0;
> +
> +err_disable_pwm:
> +	pwm_disable(ts_nbus->pwm);
> +	return ret;
>   }
>   
>   static void ts_nbus_remove(struct platform_device *pdev)

Hi,

Polite reminder.

I sent this patch a few months ago, but it never got any feed-back.

Adding Uwe and Sean who touched this file in the last months.

CJ

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ