diff mbox

soc/tegra: flowctrl: Fix error handling

Message ID 20170411034041.18662-1-christophe.jaillet@wanadoo.fr
State Accepted
Headers show

Commit Message

Christophe JAILLET April 11, 2017, 3:40 a.m. UTC
It is likely that returning returned by 'devm_ioremap_resource()' is
expected here instead of something related to 'base' which should be a
valid pointer at this point.

Fixes: 841fd94c43a4 ("soc/tegra: flowctrl: Add basic platform driver")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/soc/tegra/flowctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jon Hunter April 11, 2017, 7:15 a.m. UTC | #1
On 11/04/17 04:40, Christophe JAILLET wrote:
> It is likely that returning returned by 'devm_ioremap_resource()' is
> expected here instead of something related to 'base' which should be a
> valid pointer at this point.
> 
> Fixes: 841fd94c43a4 ("soc/tegra: flowctrl: Add basic platform driver")
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/soc/tegra/flowctrl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/tegra/flowctrl.c b/drivers/soc/tegra/flowctrl.c
> index 0e345c05fc65..5433cc7a043e 100644
> --- a/drivers/soc/tegra/flowctrl.c
> +++ b/drivers/soc/tegra/flowctrl.c
> @@ -157,7 +157,7 @@ static int tegra_flowctrl_probe(struct platform_device *pdev)
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	tegra_flowctrl_base = devm_ioremap_resource(&pdev->dev, res);
>  	if (IS_ERR(tegra_flowctrl_base))
> -		return PTR_ERR(base);
> +		return PTR_ERR(tegra_flowctrl_base);
>  
>  	iounmap(base);

Oops! Thanks for the fix.

Acked-by: Jon Hunter <jonathanh@nvidia.com>

Cheers
Jon
Thierry Reding June 13, 2017, 2:48 p.m. UTC | #2
On Tue, Apr 11, 2017 at 05:40:41AM +0200, Christophe JAILLET wrote:
> It is likely that returning returned by 'devm_ioremap_resource()' is
> expected here instead of something related to 'base' which should be a
> valid pointer at this point.
> 
> Fixes: 841fd94c43a4 ("soc/tegra: flowctrl: Add basic platform driver")
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/soc/tegra/flowctrl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Thierry
diff mbox

Patch

diff --git a/drivers/soc/tegra/flowctrl.c b/drivers/soc/tegra/flowctrl.c
index 0e345c05fc65..5433cc7a043e 100644
--- a/drivers/soc/tegra/flowctrl.c
+++ b/drivers/soc/tegra/flowctrl.c
@@ -157,7 +157,7 @@  static int tegra_flowctrl_probe(struct platform_device *pdev)
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	tegra_flowctrl_base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(tegra_flowctrl_base))
-		return PTR_ERR(base);
+		return PTR_ERR(tegra_flowctrl_base);
 
 	iounmap(base);