Commit 35216718 authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Walleij

pinctrl: at91: fix a couple NULL vs IS_ERR() checks

The devm_kasprintf_strarray() function doesn't return NULL on error,
it returns error pointers.  Update the checks accordingly.

Fixes: f494c191 ("pinctrl: at91: use devm_kasprintf() to avoid potential leaks (part 2)")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarRyan Wanner <ryan.wanner@microchip.com>
Link: https://lore.kernel.org/r/5697980e-f687-47a7-9db8-2af34ae464bd@kili.mountainSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 772be1da
......@@ -1389,8 +1389,8 @@ static int at91_pinctrl_probe(struct platform_device *pdev)
char **names;
names = devm_kasprintf_strarray(dev, "pio", MAX_NB_GPIO_PER_BANK);
if (!names)
return -ENOMEM;
if (IS_ERR(names))
return PTR_ERR(names);
for (j = 0; j < MAX_NB_GPIO_PER_BANK; j++, k++) {
char *name = names[j];
......@@ -1870,8 +1870,8 @@ static int at91_gpio_probe(struct platform_device *pdev)
}
names = devm_kasprintf_strarray(dev, "pio", chip->ngpio);
if (!names)
return -ENOMEM;
if (IS_ERR(names))
return PTR_ERR(names);
for (i = 0; i < chip->ngpio; i++)
strreplace(names[i], '-', alias_idx + 'A');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment