Commit 5d5c4c13 authored by Peter Chen's avatar Peter Chen Committed by Chanwoo Choi

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: default avatarPeter Chen <peter.chen@nxp.com>
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
parent af61f961
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment