Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 712778d0 authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Walleij
Browse files

pinctrl: single: Fix a couple error codes



We should return -ENOMEM instead of success if pcs_add_function() fails.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent d8a22212
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1181,8 +1181,10 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs,

	pgnames[0] = np->name;
	function = pcs_add_function(pcs, np, np->name, vals, found, pgnames, 1);
	if (!function)
	if (!function) {
		res = -ENOMEM;
		goto free_pins;
	}

	res = pcs_add_pingroup(pcs, np, np->name, pins, found);
	if (res < 0)
@@ -1313,8 +1315,10 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,

	pgnames[0] = np->name;
	function = pcs_add_function(pcs, np, np->name, vals, found, pgnames, 1);
	if (!function)
	if (!function) {
		res = -ENOMEM;
		goto free_pins;
	}

	res = pcs_add_pingroup(pcs, np, np->name, pins, found);
	if (res < 0)