From: Masahiro Yamada Date: Wed, 25 May 2016 11:14:13 +0000 (+0900) Subject: pinctrl: return -ENOMEM instead of -EINVAL for kasprintf() failure X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1fb1f0540deae634d454f917e3d45c27b69521a8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git pinctrl: return -ENOMEM instead of -EINVAL for kasprintf() failure -ENOMEM is more suitable error code because kasprintf() fails in case of memory shortage. Signed-off-by: Masahiro Yamada Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index d94d76ca5651..ece702881946 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)