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: <51988528.1010402@prisktech.co.nz>
Date:	Sun, 19 May 2013 19:54:16 +1200
From:	Tony Prisk <linux@...sktech.co.nz>
To:	Axel Lin <axel.lin@...ics.com>
CC:	Linus Walleij <linus.walleij@...ricsson.com>,
	Maxime Ripard <maxime.ripard@...e-electrons.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] pinctrl: Don't override the error code in probe error
 handling

On 19/05/13 17:58, Axel Lin wrote:
> Otherwise, we return 0 in probe error paths when gpiochip_remove() returns 0.
> Also show error message if gpiochip_remove() fails.
>
> Signed-off-by: Axel Lin <axel.lin@...ics.com>
> Cc: Linus Walleij <linus.walleij@...ricsson.com>
> Cc: Maxime Ripard <maxime.ripard@...e-electrons.com>
> Cc: Tony Prisk <linux@...sktech.co.nz>
> ---
>   drivers/pinctrl/pinctrl-coh901.c     | 3 ++-
>   drivers/pinctrl/pinctrl-sunxi.c      | 3 ++-
>   drivers/pinctrl/vt8500/pinctrl-wmt.c | 3 +--
>   3 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c
> index 20da215..ea98df9 100644
> --- a/drivers/pinctrl/pinctrl-coh901.c
> +++ b/drivers/pinctrl/pinctrl-coh901.c
> @@ -830,7 +830,8 @@ static int __init u300_gpio_probe(struct platform_device *pdev)
>   	return 0;
>   
>   err_no_range:
> -	err = gpiochip_remove(&gpio->chip);
> +	if (gpiochip_remove(&gpio->chip))
> +		dev_err(&pdev->dev, "failed to remove gpio chip\n");
>   err_no_chip:
>   err_no_domain:
>   err_no_port:
> diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c
> index c52fc2c..c058529 100644
> --- a/drivers/pinctrl/pinctrl-sunxi.c
> +++ b/drivers/pinctrl/pinctrl-sunxi.c
> @@ -2000,7 +2000,8 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev)
>   	return 0;
>   
>   gpiochip_error:
> -	ret = gpiochip_remove(pctl->chip);
> +	if (gpiochip_remove(pctl->chip))
> +		dev_err(&pdev->dev, "failed to remove gpio chip\n");
>   pinctrl_error:
>   	pinctrl_unregister(pctl->pctl_dev);
>   	return ret;
> diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c
> index e877082..fb30edf3 100644
> --- a/drivers/pinctrl/vt8500/pinctrl-wmt.c
> +++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c
> @@ -609,8 +609,7 @@ int wmt_pinctrl_probe(struct platform_device *pdev,
>   	return 0;
>   
>   fail_range:
> -	err = gpiochip_remove(&data->gpio_chip);
> -	if (err)
> +	if (gpiochip_remove(&data->gpio_chip))
>   		dev_err(&pdev->dev, "failed to remove gpio chip\n");
>   fail_gpio:
>   	pinctrl_unregister(data->pctl_dev);
Good catch.

for pinctrl-wmt
Acked-by: Tony Prisk <linux@...sktech.co.nz>

Regards
Tony P
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ