Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1406845 > unrolled thread
| Started by | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| First post | 2016-05-25 13:20 +0200 |
| Last post | 2016-05-31 10:40 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] pinctrl: return -ENOMEM instead of -EINVAL for kasprintf() failure Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-05-25 13:20 +0200
Re: [PATCH] pinctrl: return -ENOMEM instead of -EINVAL for kasprintf() failure Linus Walleij <linus.walleij@linaro.org> - 2016-05-31 10:40 +0200
| From | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| Date | 2016-05-25 13:20 +0200 |
| Subject | [PATCH] pinctrl: return -ENOMEM instead of -EINVAL for kasprintf() failure |
| Message-ID | <rCF0Z-kh-7@gated-at.bofh.it> |
-ENOMEM is more suitable error code because kasprintf() fails in case of memory shortage. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> --- drivers/pinctrl/pinmux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index d94d76c..ece7028 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c @@ -256,7 +256,7 @@ int pinmux_request_gpio(struct pinctrl_dev *pctldev, /* Conjure some name stating what chip and pin this is taken by */ owner = kasprintf(GFP_KERNEL, "%s:%d", range->name, gpio); if (!owner) - return -EINVAL; + return -ENOMEM; ret = pin_request(pctldev, pin, owner, range); if (ret < 0) -- 1.9.1
[toc] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2016-05-31 10:40 +0200 |
| Subject | Re: [PATCH] pinctrl: return -ENOMEM instead of -EINVAL for kasprintf() failure |
| Message-ID | <rENnr-iy-15@gated-at.bofh.it> |
| In reply to | #1406845 |
On Wed, May 25, 2016 at 1:14 PM, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: > -ENOMEM is more suitable error code because kasprintf() fails > in case of memory shortage. > > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Obviously correct. Patch applied. Yours, Linus Walleij
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web