mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
mmi_info: Add missing of_node_put()
of_find_node_by_path() returns a node point with refcount incremented and need use of_node_put() to decrement refcount Change-Id: Ib1cbdc4c40b1ea5e9bfc1c5d02ddd231185a42b1 Reviewed-on: https://gerrit.mot.com/2269870 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Zhenxin Xi <xizx@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
e9dcdc46e0
commit
f1c46d33ce
1 changed files with 6 additions and 4 deletions
|
|
@ -54,15 +54,16 @@ bool mmi_device_is_available(struct device_node *np)
|
|||
}
|
||||
path = prop->value;
|
||||
|
||||
mmi_np = of_find_node_by_path(path);
|
||||
if (mmi_np == NULL)
|
||||
return false;
|
||||
|
||||
mmi_dts = of_prop_next_string(prop, path);
|
||||
if (mmi_dts == NULL)
|
||||
return false;
|
||||
|
||||
mmi_np = of_find_node_by_path(path);
|
||||
if (mmi_np == NULL)
|
||||
return false;
|
||||
|
||||
mmi_dts_val = of_get_property(mmi_np, mmi_dts, &len);
|
||||
of_node_put(mmi_np);
|
||||
if (mmi_dts_val == NULL || len <= 0)
|
||||
return false;
|
||||
|
||||
|
|
@ -105,6 +106,7 @@ struct device_node *mmi_check_dynamic_device_node(char *dev_name)
|
|||
return NULL;
|
||||
|
||||
prop = of_find_property(node, "mmi,dynamic_devices", &len);
|
||||
of_node_put(node);
|
||||
if (prop == NULL || len < 0) {
|
||||
pr_err("%s: cannot find mmi,dynamic_devices property\n", __func__);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue