[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <154ad406-02a0-8f37-4a47-a49b6c90da5d@wanadoo.fr>
Date: Wed, 24 Jun 2020 07:05:05 +0200
From: Marion & Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Cc: stable@...r.kernel.org, Dan Carpenter <dan.carpenter@...cle.com>,
Linus Walleij <linus.walleij@...aro.org>,
Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 5.7 318/477] pinctrl: freescale: imx: Use devm_of_iomap()
to avoid a resource leak in case of error in imx_pinctrl_probe()
Hi,
This one must NOT be included. It generates a regression.
This should be removed from 5.4 as well.
See 13f2d25b951f139064ec2dd53c0c7ebdf8d8007e.
There is also a thread on ML about it. I couldn't find it right away,
but I'm sure that Dan will be quicker than me for finding it, if needed ;-).
CJ
Le 23/06/2020 à 21:55, Greg Kroah-Hartman a écrit :
> From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
>
> [ Upstream commit ba403242615c2c99e27af7984b1650771a2cc2c9 ]
>
> Use 'devm_of_iomap()' instead 'of_iomap()' to avoid a resource leak in
> case of error.
>
> Update the error handling code accordingly.
>
> Fixes: 26d8cde5260b ("pinctrl: freescale: imx: add shared input select reg support")
> Suggested-by: Dan Carpenter <dan.carpenter@...cle.com>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> Reviewed-by: Dan Carpenter <dan.carpenter@...cle.com>
> Link: https://lore.kernel.org/r/20200602200626.677981-1-christophe.jaillet@wanadoo.fr
> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
> Signed-off-by: Sasha Levin <sashal@...nel.org>
> ---
> drivers/pinctrl/freescale/pinctrl-imx.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
> index 1f81569c7ae3b..cb7e0f08d2cf4 100644
> --- a/drivers/pinctrl/freescale/pinctrl-imx.c
> +++ b/drivers/pinctrl/freescale/pinctrl-imx.c
> @@ -824,12 +824,13 @@ int imx_pinctrl_probe(struct platform_device *pdev,
> return -EINVAL;
> }
>
> - ipctl->input_sel_base = of_iomap(np, 0);
> + ipctl->input_sel_base = devm_of_iomap(&pdev->dev, np,
> + 0, NULL);
> of_node_put(np);
> - if (!ipctl->input_sel_base) {
> + if (IS_ERR(ipctl->input_sel_base)) {
> dev_err(&pdev->dev,
> "iomuxc input select base address not found\n");
> - return -ENOMEM;
> + return PTR_ERR(ipctl->input_sel_base);
> }
> }
> }
Powered by blists - more mailing lists