FAILED: patch "[PATCH] pinctrl: samsung: Add of_node_put() before return in error" failed to apply to 4.4-stable tree
Subsystems (4)
[email protected]
maintainerThe patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3d2557ab75d4c568c79eefa2e550e0d80348a6bd Mon Sep 17 00:00:00 2001
From: Nishka Dasgupta <[email protected]>
Date: Sun, 4 Aug 2019 21:32:00 +0530
Subject: [PATCH] pinctrl: samsung: Add of_node_put() before return in error
path
Each iteration of for_each_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return of exynos_eint_wkup_init() error path.
Issue found with Coccinelle.
drivers/pinctrl/samsung/pinctrl-exynos.c +3 -1
@@ -486,8 +486,10 @@ 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) +if (!irq_chip) { +of_node_put (np);return -ENOMEM ; + } wkup_np = np;break ; }