linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] pinctrl: single: Fix a couple error codes
@ 2016-11-16 11:41 Dan Carpenter
  2016-11-16 14:49 ` Tony Lindgren
  2016-11-16 19:57 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-11-16 11:41 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Haojian Zhuang, Linus Walleij, linux-omap, linux-gpio,
	kernel-janitors

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

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 2b196e5..a5a0392 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] pinctrl: single: Fix a couple error codes
  2016-11-16 11:41 [patch] pinctrl: single: Fix a couple error codes Dan Carpenter
@ 2016-11-16 14:49 ` Tony Lindgren
  2016-11-16 19:57 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2016-11-16 14:49 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Haojian Zhuang, Linus Walleij, linux-omap, linux-gpio,
	kernel-janitors

* Dan Carpenter <dan.carpenter@oracle.com> [161116 03:43]:
> We should return -ENOMEM instead of success if pcs_add_function() fails.

Looks good to me thanks:

Acked-by: Tony Lindgren <tony@atomide.com>

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> index 2b196e5..a5a0392 100644
> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] pinctrl: single: Fix a couple error codes
  2016-11-16 11:41 [patch] pinctrl: single: Fix a couple error codes Dan Carpenter
  2016-11-16 14:49 ` Tony Lindgren
@ 2016-11-16 19:57 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2016-11-16 19:57 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Tony Lindgren, Haojian Zhuang, Linux-OMAP,
	linux-gpio@vger.kernel.org, kernel-janitors

On Wed, Nov 16, 2016 at 12:41 PM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:

> We should return -ENOMEM instead of success if pcs_add_function() fails.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Patch applied with Tony's ACK.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-16 19:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-16 11:41 [patch] pinctrl: single: Fix a couple error codes Dan Carpenter
2016-11-16 14:49 ` Tony Lindgren
2016-11-16 19:57 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).