From: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] gpiolib: Fix missing array end sentinel in quirks array
Date: Tue, 20 Sep 2022 16:27:18 +0200 [thread overview]
Message-ID: <20220920142718.633062-1-frattaroli.nicolas@gmail.com> (raw)
Without the sentinel, the loop never actually terminates if there
are no quirks, and wreaks havoc across the kernel resulting in a
juicy panic.
Fix this by adding a NULL at the end.
Fixes: a2b5e207cade ("gpiolib: rework quirk handling in of_find_gpio()")
Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
---
drivers/gpio/gpiolib-of.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 95be5f0d2623..1b60cd04883f 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -498,6 +498,7 @@ static const of_find_gpio_quirk of_find_gpio_quirks[] = {
of_find_regulator_gpio,
of_find_arizona_gpio,
of_find_usb_gpio,
+ NULL,
};
struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,
--
2.37.3
next reply other threads:[~2022-09-20 14:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-20 14:27 Nicolas Frattaroli [this message]
2022-09-20 14:29 ` [PATCH] gpiolib: Fix missing array end sentinel in quirks array Nicolas Frattaroli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220920142718.633062-1-frattaroli.nicolas@gmail.com \
--to=frattaroli.nicolas@gmail.com \
--cc=brgl@bgdev.pl \
--cc=dmitry.torokhov@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox