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: <20140829185744.GK12494@sonymobile.com>
Date:	Fri, 29 Aug 2014 11:57:46 -0700
From:	Bjorn Andersson <bjorn.andersson@...ymobile.com>
To:	Pramod Gurav <pramod.gurav@...rtplayin.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	"Ivan T. Ivanov" <iivanov@...sol.com>
Subject: Re: [PATCH v2] pinctrl: qcom: remove gpiochip in failure cases

On Fri 29 Aug 01:11 PDT 2014, Pramod Gurav wrote:

> This patch releases gpiochip related resources by calling
> gpiochip_remove when either of gpiochip_add_pin_range and
> gpiochip_irqchip_add fails.
> 
> CC: Linus Walleij <linus.walleij@...aro.org>
> CC: Bjorn Andersson <bjorn.andersson@...ymobile.com>
> CC: "Ivan T. Ivanov" <iivanov@...sol.com>
> Signed-off-by: Pramod Gurav <pramod.gurav@...rtplayin.com>

Acked-by: Bjorn Andersson <bjorn.andersson@...ymobile.com>

> ---
> 
> Changes since v1:
> - In v1 of this patch gpiochip_remove was called only in failure case of
>   gpiochip_irqchip_add. This patchs adds a call to gpiochip_remove in failure
>   case of gpiochip_add_pin_range as well.
> 
>  drivers/pinctrl/qcom/pinctrl-msm.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
> index 2738108..9175bbc 100644
> --- a/drivers/pinctrl/qcom/pinctrl-msm.c
> +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
> @@ -829,6 +829,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
>  	ret = gpiochip_add_pin_range(&pctrl->chip, dev_name(pctrl->dev), 0, 0, chip->ngpio);
>  	if (ret) {
>  		dev_err(pctrl->dev, "Failed to add pin range\n");
> +		gpiochip_remove(&pctrl->chip);
>  		return ret;
>  	}
>  
> @@ -839,6 +840,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
>  				   IRQ_TYPE_NONE);
>  	if (ret) {
>  		dev_err(pctrl->dev, "Failed to add irqchip to gpiochip\n");
> +		gpiochip_remove(&pctrl->chip);
>  		return -ENOSYS;
>  	}
>  

It seems like pinctrl-st.c and pinctrl-sirf.c is suffering the same problem,
would you mind spinning patches for those too?

Regards,
Bjorn
--
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