Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1406845 > unrolled thread

[PATCH] pinctrl: return -ENOMEM instead of -EINVAL for kasprintf() failure

Started byMasahiro Yamada <yamada.masahiro@socionext.com>
First post2016-05-25 13:20 +0200
Last post2016-05-31 10:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [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

#1406845 — [PATCH] pinctrl: return -ENOMEM instead of -EINVAL for kasprintf() failure

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-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]


#1409989 — Re: [PATCH] pinctrl: return -ENOMEM instead of -EINVAL for kasprintf() failure

FromLinus Walleij <linus.walleij@linaro.org>
Date2016-05-31 10:40 +0200
SubjectRe: [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