All of lore.kernel.org
 help / color / mirror / Atom feed
From: angkery <angkery@163.com>
To: linus.walleij@linaro.org, grandmaster@al2klimov.de,
	baijiaju1990@gmail.com, zhengyongjun3@huawei.com,
	jrdr.linux@gmail.com
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Junlin Yang <yangjunlin@yulong.com>
Subject: [PATCH] pinctrl: ti: fix error return code of ti_iodelay_dt_node_to_map()
Date: Tue, 30 Mar 2021 14:26:55 +0800	[thread overview]
Message-ID: <20210330062655.1027-1-angkery@163.com> (raw)

From: Junlin Yang <yangjunlin@yulong.com>

when devm_kcalloc fails, use -ENOMEM instead of -EINVAL,
and consistent with other devm_kcalloc return values.

Signed-off-by: Junlin Yang <yangjunlin@yulong.com>
---
 drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
index e584826..4e23827 100644
--- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
+++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
@@ -511,8 +511,10 @@ static int ti_iodelay_dt_node_to_map(struct pinctrl_dev *pctldev,
 	}
 
 	pins = devm_kcalloc(iod->dev, rows, sizeof(*pins), GFP_KERNEL);
-	if (!pins)
+	if (!pins) {
+		error = -ENOMEM;
 		goto free_group;
+	}
 
 	cfg = devm_kcalloc(iod->dev, rows, sizeof(*cfg), GFP_KERNEL);
 	if (!cfg) {
-- 
1.9.1



             reply	other threads:[~2021-03-30  8:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30  6:26 angkery [this message]
2021-04-08 13:57 ` [PATCH] pinctrl: ti: fix error return code of ti_iodelay_dt_node_to_map() Linus Walleij

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=20210330062655.1027-1-angkery@163.com \
    --to=angkery@163.com \
    --cc=baijiaju1990@gmail.com \
    --cc=grandmaster@al2klimov.de \
    --cc=jrdr.linux@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yangjunlin@yulong.com \
    --cc=zhengyongjun3@huawei.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.