From f15444796465b2d1514933c20a44417f4a09a2fd Mon Sep 17 00:00:00 2001 From: Loic Prylli Date: Thu, 12 Sep 2019 14:16:07 -0700 Subject: [PATCH] gpio: aspeed: fix check for pointer return value If dts does not have a pinctrl passthrough property, the kernel would oops or misbehave before the fix. --- drivers/gpio/gpio-aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c index d4aaf7fa8e4b..26f487296365 100644 --- a/drivers/gpio/gpio-aspeed.c +++ b/drivers/gpio/gpio-aspeed.c @@ -1205,7 +1205,7 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev) * of the GPIO pins, so they can be requested at runtime. */ pinctrl = pinctrl_get_select(&pdev->dev, "pass-through"); - if (pinctrl) + if (!IS_ERR(pinctrl)) pinctrl_put(pinctrl); /*