pinctrl: ambarella: fix NULL vs IS_ERR() bug in amb_pinctrl_register()
Subsystems (3)
PATCH 1/1 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 b40e9d140c24 ("pinctrl: ambarella: add CV75 pin controller")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/pinctrl/pinctrl-ambarella.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/pinctrl-ambarella.c +2 -2
@@ -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;
Signature · 1 line
2.53.0
Linus Walleij
maintainerQuoted 6 lines · Dan Carpenter
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 <[email protected]>
Patch applied!
Yours,
Linus Walleij