Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1406845
| From | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] pinctrl: return -ENOMEM instead of -EINVAL for kasprintf() failure |
| Date | 2016-05-25 13:20 +0200 |
| Message-ID | <rCF0Z-kh-7@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
-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
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[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
csiph-web