pinctrl: ambarella: fix NULL vs IS_ERR() bug in amb_pinctrl_register()

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: b40e9d140c ("pinctrl: ambarella: add CV75 pin controller")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
This commit is contained in:
Dan Carpenter 2026-10-02 17:42:04 +03:00 committed by Linus Walleij
parent b89f7dd31a
commit 39b717b20c

View File

@ -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;