From: Tony Lindgren <tony@atomide.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>,
linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] pinctrl: single: Fix a couple error codes
Date: Wed, 16 Nov 2016 06:49:02 -0800 [thread overview]
Message-ID: <20161116144901.GO4082@atomide.com> (raw)
In-Reply-To: <20161116114151.GA31224@mwanda>
* 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)
next prev parent reply other threads:[~2016-11-16 14:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-16 11:41 [patch] pinctrl: single: Fix a couple error codes Dan Carpenter
2016-11-16 14:49 ` Tony Lindgren [this message]
2016-11-16 19:57 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161116144901.GO4082@atomide.com \
--to=tony@atomide.com \
--cc=dan.carpenter@oracle.com \
--cc=haojian.zhuang@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).