From 34a3942845ac3264ce27c648ae5486d302c3e6d8 Mon Sep 17 00:00:00 2001 From: Loic Prylli Date: Thu, 12 Sep 2019 15:10:53 -0700 Subject: 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. --- ...aspeed-fix-check-for-pointer-return-value.patch | 24 ++++++++++++++++++++++ .../recipes-kernel/linux/linux-aspeed_%.bbappend | 1 + 2 files changed, 25 insertions(+) create mode 100644 meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0007-gpio-aspeed-fix-check-for-pointer-return-value.patch (limited to 'meta-openbmc-mods/meta-ast2500') diff --git a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0007-gpio-aspeed-fix-check-for-pointer-return-value.patch b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0007-gpio-aspeed-fix-check-for-pointer-return-value.patch new file mode 100644 index 000000000..ef225bbf3 --- /dev/null +++ b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed/0007-gpio-aspeed-fix-check-for-pointer-return-value.patch @@ -0,0 +1,24 @@ +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); + + /* diff --git a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed_%.bbappend b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed_%.bbappend index 909e7cccc..3dc7399ca 100644 --- a/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed_%.bbappend +++ b/meta-openbmc-mods/meta-ast2500/recipes-kernel/linux/linux-aspeed_%.bbappend @@ -4,6 +4,7 @@ SRC_URI += "file://intel-ast2500.cfg \ file://0002-Enable-pass-through-on-GPIOE1-and-GPIOE3-free.patch \ file://0003-Enable-GPIOE0-and-GPIOE2-pass-through-by-default.patch \ file://0006-Allow-monitoring-of-power-control-input-GPIOs.patch \ + file://0007-gpio-aspeed-fix-check-for-pointer-return-value.patch \ file://0001-aspeed-pwm-tacho-change-default-fan-speed.patch \ file://0001-Report-link-statistics-for-the-NCSI-channel.patch \ " -- cgit v1.2.3