* [PATCH] pinctrl: ti: fix error return code of ti_iodelay_dt_node_to_map()
@ 2021-03-30 6:26 angkery
2021-04-08 13:57 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: angkery @ 2021-03-30 6:26 UTC (permalink / raw)
To: linus.walleij, grandmaster, baijiaju1990, zhengyongjun3, jrdr.linux
Cc: linux-gpio, linux-kernel, Junlin Yang
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pinctrl: ti: fix error return code of ti_iodelay_dt_node_to_map()
2021-03-30 6:26 [PATCH] pinctrl: ti: fix error return code of ti_iodelay_dt_node_to_map() angkery
@ 2021-04-08 13:57 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2021-04-08 13:57 UTC (permalink / raw)
To: angkery
Cc: Alexander A. Klimov, Jia-Ju Bai, Zheng Yongjun, Souptick Joarder,
open list:GPIO SUBSYSTEM, linux-kernel, Junlin Yang
On Tue, Mar 30, 2021 at 10:39 AM angkery <angkery@163.com> wrote:
> 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>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-08 13:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 6:26 [PATCH] pinctrl: ti: fix error return code of ti_iodelay_dt_node_to_map() angkery
2021-04-08 13:57 ` Linus Walleij
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.