[<prev] [next>] [day] [month] [year] [list]
Message-ID: <786ef7b5-f889-7951-7479-e9e1f901f041@users.sourceforge.net>
Date: Fri, 14 Apr 2017 11:11:31 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-gpio@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
Gary Bisson <gary.bisson@...ndarydevices.com>,
Laxman Dewangan <ldewangan@...dia.com>,
Linus Walleij <linus.walleij@...aro.org>,
Paul Gortmaker <paul.gortmaker@...driver.com>,
Peng Fan <van.freenix@...il.com>,
Shawn Guo <shawnguo@...nel.org>,
Vladimir Zapolskiy <vladimir_zapolskiy@...tor.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 03/10] pinctrl: imx: Return directly after a failed
devm_kcalloc() in imx_pinctrl_parse_functions()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 13 Apr 2017 15:12:20 +0200
Add a check for a null pointer and return an error code
after a memory allocation failure was detected.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/pinctrl/freescale/pinctrl-imx.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index 975ed40cb774..f835e8210ace 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -585,6 +585,8 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
func->num_group_names,
sizeof(*func->group_names),
GFP_KERNEL);
+ if (!func->group_names)
+ return -ENOMEM;
for_each_child_of_node(np, child) {
func->group_names[i] = child->name;
--
2.12.2
Powered by blists - more mailing lists