[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170523184141.24284-2-krzk@kernel.org>
Date: Tue, 23 May 2017 20:41:40 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Tomasz Figa <tomasz.figa@...il.com>,
Krzysztof Kozlowski <krzk@...nel.org>,
Sylwester Nawrocki <s.nawrocki@...sung.com>,
Linus Walleij <linus.walleij@...aro.org>,
Kukjin Kim <kgene@...nel.org>,
linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] pinctrl: samsung: Handle memory allocation failure during wakeup banks init
Check if kmemdup failed during wakeup banks initialization. Otherwise
NULL pointer would be stored under "irq_chip" member of bank and later
dereferenced in interrupt handler.
Signed-off-by: Krzysztof Kozlowski <krzk@...nel.org>
---
drivers/pinctrl/samsung/pinctrl-exynos.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c
index cdea07af308a..66122627b3ed 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos.c
@@ -503,6 +503,8 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d)
if (match) {
irq_chip = kmemdup(match->data,
sizeof(*irq_chip), GFP_KERNEL);
+ if (!irq_chip)
+ return -ENOMEM;
wkup_np = np;
break;
}
--
2.9.3
Powered by blists - more mailing lists