From 4d97894a8488ec10e12eefd13e4348b9af1ca81f Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Fri, 1 Jul 2016 18:41:55 +0900 Subject: [PATCH] UPSTREAM: extcon: add missing of_node_put after calling of_parse_phandle of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using. Change-Id: I96ad96b55e6f6c5e5335d12aeb5963c1b06451b3 Signed-off-by: Peter Chen Signed-off-by: Chanwoo Choi Signed-off-by: Chris Zhong (cherry picked from commit 5d5c4c139dd766dff903ba35d72fb3ec90022e91) --- drivers/extcon/extcon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index 3b1ad4ce098e..7009687c692b 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -861,10 +861,12 @@ struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index) list_for_each_entry(edev, &extcon_dev_list, entry) { if (edev->dev.parent && edev->dev.parent->of_node == node) { mutex_unlock(&extcon_dev_list_lock); + of_node_put(node); return edev; } } mutex_unlock(&extcon_dev_list_lock); + of_node_put(node); return ERR_PTR(-EPROBE_DEFER); } -- 2.34.1