From: Tony Lindgren <tony@atomide.com>
To: Axel Haslam <ahaslam@baylibre.com>
Cc: haojian.zhuang@linaro.org, linus.walleij@linaro.org,
khilman@baylibre.com, nsekhar@ti.com,
linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pinctrl: single: check for any error when getting rows
Date: Wed, 9 Nov 2016 08:19:27 -0700 [thread overview]
Message-ID: <20161109151926.GS2428@atomide.com> (raw)
In-Reply-To: <20161109141706.12624-1-ahaslam@baylibre.com>
* Axel Haslam <ahaslam@baylibre.com> [161109 07:19]:
> pinctrl_count_index_with_args returns -ENOENT not
> -EINVAL. The return check would pass, and we would
> try to kzalloc with a negative error size throwing
> a warning.
>
> Instead of checking for -EINVAL specifically, lets
> check for any error and avoid negative size allocations.
>
> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Thanks for fixing that:
Acked-by: Tony Lindgren <tony@atomide.com>
> ---
> drivers/pinctrl/pinctrl-single.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> index 539f31c..56e22be 100644
> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -1228,7 +1228,7 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
> struct pcs_function *function;
>
> rows = pinctrl_count_index_with_args(np, name);
> - if (rows == -EINVAL)
> + if (rows < 0)
> return rows;
>
> npins_in_row = pcs->width / pcs->bits_per_pin;
> --
> 2.10.1
>
WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pinctrl: single: check for any error when getting rows
Date: Wed, 9 Nov 2016 08:19:27 -0700 [thread overview]
Message-ID: <20161109151926.GS2428@atomide.com> (raw)
In-Reply-To: <20161109141706.12624-1-ahaslam@baylibre.com>
* Axel Haslam <ahaslam@baylibre.com> [161109 07:19]:
> pinctrl_count_index_with_args returns -ENOENT not
> -EINVAL. The return check would pass, and we would
> try to kzalloc with a negative error size throwing
> a warning.
>
> Instead of checking for -EINVAL specifically, lets
> check for any error and avoid negative size allocations.
>
> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Thanks for fixing that:
Acked-by: Tony Lindgren <tony@atomide.com>
> ---
> drivers/pinctrl/pinctrl-single.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> index 539f31c..56e22be 100644
> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -1228,7 +1228,7 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
> struct pcs_function *function;
>
> rows = pinctrl_count_index_with_args(np, name);
> - if (rows == -EINVAL)
> + if (rows < 0)
> return rows;
>
> npins_in_row = pcs->width / pcs->bits_per_pin;
> --
> 2.10.1
>
next prev parent reply other threads:[~2016-11-09 15:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-09 14:17 [PATCH] pinctrl: single: check for any error when getting rows Axel Haslam
2016-11-09 14:17 ` Axel Haslam
2016-11-09 15:19 ` Tony Lindgren [this message]
2016-11-09 15:19 ` Tony Lindgren
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=20161109151926.GS2428@atomide.com \
--to=tony@atomide.com \
--cc=ahaslam@baylibre.com \
--cc=haojian.zhuang@linaro.org \
--cc=khilman@baylibre.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=nsekhar@ti.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.