summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2017-05-23 21:41:40 +0300
committerKrzysztof Kozlowski <krzk@kernel.org>2017-06-07 21:40:48 +0300
commita1ea9a400f5c76cdbe31a8f5c3154f464d84b803 (patch)
tree9a819ac5127a9c8499e1d9086fb1e615ac99595c /drivers/pinctrl
parent71b96c3a8a2d35f74ca7559f9d1b123d97da6f4f (diff)
downloadlinux-a1ea9a400f5c76cdbe31a8f5c3154f464d84b803.tar.xz
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@kernel.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/samsung/pinctrl-exynos.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c
index 727462cc670c..96068b40d32a 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos.c
@@ -479,6 +479,8 @@ 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;
}