diff options
author | Peter Chen <peter.chen@nxp.com> | 2016-07-01 05:41:55 -0400 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2016-07-02 00:24:25 -0400 |
commit | 5d5c4c139dd766dff903ba35d72fb3ec90022e91 (patch) | |
tree | 473ad5944481afcb5c40372b6d0e517f35e1910e /drivers/extcon/extcon.c | |
parent | af61f96109b73fefbe0589c320d2219567f4f660 (diff) |
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 <peter.chen@nxp.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon/extcon.c')
-rw-r--r-- | drivers/extcon/extcon.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) | |||
861 | list_for_each_entry(edev, &extcon_dev_list, entry) { | 861 | list_for_each_entry(edev, &extcon_dev_list, entry) { |
862 | if (edev->dev.parent && edev->dev.parent->of_node == node) { | 862 | if (edev->dev.parent && edev->dev.parent->of_node == node) { |
863 | mutex_unlock(&extcon_dev_list_lock); | 863 | mutex_unlock(&extcon_dev_list_lock); |
864 | of_node_put(node); | ||
864 | return edev; | 865 | return edev; |
865 | } | 866 | } |
866 | } | 867 | } |
867 | mutex_unlock(&extcon_dev_list_lock); | 868 | mutex_unlock(&extcon_dev_list_lock); |
869 | of_node_put(node); | ||
868 | 870 | ||
869 | return ERR_PTR(-EPROBE_DEFER); | 871 | return ERR_PTR(-EPROBE_DEFER); |
870 | } | 872 | } |