From: Peter Chen Date: Fri, 1 Jul 2016 09:41:55 +0000 (+0900) Subject: extcon: add missing of_node_put after calling of_parse_phandle X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5d5c4c139dd766dff903ba35d72fb3ec90022e91;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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. Signed-off-by: Peter Chen Signed-off-by: Chanwoo Choi --- diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index 862334e69cf1..8682efc0f57b 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); }