* [PATCH next] pinctrl: ambarella: fix NULL vs IS_ERR() bug in amb_pinctrl_register()
@ 2026-10-02 14:42 Dan Carpenter
2026-10-02 21:48 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2026-10-02 14:42 UTC (permalink / raw)
To: Long Zhao; +Cc: Linus Walleij, linux-gpio, kernel-janitors
The devm_kasprintf_strarray() function never returns NULL, it returns
error pointers on error or a valid pointer on success. Fix the error
checking to match.
Fixes: b40e9d140c24 ("pinctrl: ambarella: add CV75 pin controller")
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
drivers/pinctrl/pinctrl-ambarella.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-ambarella.c b/drivers/pinctrl/pinctrl-ambarella.c
index 83afef6a123f..5ed1010c5ce5 100644
--- a/drivers/pinctrl/pinctrl-ambarella.c
+++ b/drivers/pinctrl/pinctrl-ambarella.c
@@ -426,8 +426,8 @@ static int amb_pinctrl_register(struct amb_pinctrl *ipc)
return -ENOMEM;
names = devm_kasprintf_strarray(ipc->dev, "io", ipc->data->npins);
- if (!names)
- return -ENOMEM;
+ if (IS_ERR(names))
+ return PTR_ERR(names);
for (unsigned int pin = 0; pin < ipc->data->npins; pin++) {
pindesc[pin].number = pin;
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH next] pinctrl: ambarella: fix NULL vs IS_ERR() bug in amb_pinctrl_register()
2026-10-02 14:42 [PATCH next] pinctrl: ambarella: fix NULL vs IS_ERR() bug in amb_pinctrl_register() Dan Carpenter
@ 2026-10-02 21:48 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2026-10-02 21:48 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Long Zhao, linux-gpio, kernel-janitors
On Fri, Oct 2, 2026 at 4:42 PM Dan Carpenter <error27@gmail.com> wrote:
> The devm_kasprintf_strarray() function never returns NULL, it returns
> error pointers on error or a valid pointer on success. Fix the error
> checking to match.
>
> Fixes: b40e9d140c24 ("pinctrl: ambarella: add CV75 pin controller")
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Patch applied!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-02 21:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-02 14:42 [PATCH next] pinctrl: ambarella: fix NULL vs IS_ERR() bug in amb_pinctrl_register() Dan Carpenter
2026-10-02 21:48 ` 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.