summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0007-gpio-aspeed-fix-check-for-pointer-return-value.patch
blob: ef225bbf378f6e5a587c546ed705e055ae15d60a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From f15444796465b2d1514933c20a44417f4a09a2fd Mon Sep 17 00:00:00 2001
From: Loic Prylli <lprylli@netflix.com>
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);
 
 	/*