All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: x-gene: fix devm_ioremap_resource() check
@ 2015-03-29  2:37 Vladimir Zapolskiy
  2015-04-07  9:47 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Zapolskiy @ 2015-03-29  2:37 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot; +Cc: linux-gpio

devm_ioremap_resource() returns IOMEM_ERR_PTR() and it never
returns NULL, fix the check to prevent access to invalid
virtual address.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
 drivers/gpio/gpio-xgene-sb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c
index b6a15c3..fb9d29a 100644
--- a/drivers/gpio/gpio-xgene-sb.c
+++ b/drivers/gpio/gpio-xgene-sb.c
@@ -93,7 +93,7 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev)
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	regs = devm_ioremap_resource(&pdev->dev, res);
-	if (!regs)
+	if (IS_ERR(regs))
 		return PTR_ERR(regs);
 
 	ret = bgpio_init(&priv->bgc, &pdev->dev, 4,
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gpio: x-gene: fix devm_ioremap_resource() check
  2015-03-29  2:37 [PATCH] gpio: x-gene: fix devm_ioremap_resource() check Vladimir Zapolskiy
@ 2015-04-07  9:47 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2015-04-07  9:47 UTC (permalink / raw)
  To: Vladimir Zapolskiy; +Cc: Alexandre Courbot, linux-gpio

On Sun, Mar 29, 2015 at 4:37 AM, Vladimir Zapolskiy <vz@mleia.com> wrote:

> devm_ioremap_resource() returns IOMEM_ERR_PTR() and it never
> returns NULL, fix the check to prevent access to invalid
> virtual address.
>
> Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-07  9:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-29  2:37 [PATCH] gpio: x-gene: fix devm_ioremap_resource() check Vladimir Zapolskiy
2015-04-07  9:47 ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.