diff options
Diffstat (limited to 'drivers/pinctrl/freescale')
-rw-r--r-- | drivers/pinctrl/freescale/pinctrl-imx.c | 13 | ||||
-rw-r--r-- | drivers/pinctrl/freescale/pinctrl-mxs.c | 12 |
2 files changed, 19 insertions, 6 deletions
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 83ff9532bae6..9f42036c5fbb 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -672,8 +672,10 @@ static int imx_pinctrl_parse_functions(struct device_node *np, grp = devm_kzalloc(ipctl->dev, sizeof(struct group_desc), GFP_KERNEL); - if (!grp) + if (!grp) { + of_node_put(child); return -ENOMEM; + } mutex_lock(&ipctl->mutex); radix_tree_insert(&pctl->pin_group_tree, @@ -697,12 +699,17 @@ static bool imx_pinctrl_dt_is_flat_functions(struct device_node *np) struct device_node *pinctrl_np; for_each_child_of_node(np, function_np) { - if (of_property_read_bool(function_np, "fsl,pins")) + if (of_property_read_bool(function_np, "fsl,pins")) { + of_node_put(function_np); return true; + } for_each_child_of_node(function_np, pinctrl_np) { - if (of_property_read_bool(pinctrl_np, "fsl,pins")) + if (of_property_read_bool(pinctrl_np, "fsl,pins")) { + of_node_put(pinctrl_np); + of_node_put(function_np); return false; + } } } diff --git a/drivers/pinctrl/freescale/pinctrl-mxs.c b/drivers/pinctrl/freescale/pinctrl-mxs.c index 641b3088876f..735cedd0958a 100644 --- a/drivers/pinctrl/freescale/pinctrl-mxs.c +++ b/drivers/pinctrl/freescale/pinctrl-mxs.c @@ -488,8 +488,10 @@ static int mxs_pinctrl_probe_dt(struct platform_device *pdev, if (of_property_read_u32(child, "reg", &val)) { ret = mxs_pinctrl_parse_group(pdev, child, idxg++, NULL); - if (ret) + if (ret) { + of_node_put(child); return ret; + } continue; } @@ -499,15 +501,19 @@ static int mxs_pinctrl_probe_dt(struct platform_device *pdev, f->ngroups, sizeof(*f->groups), GFP_KERNEL); - if (!f->groups) + if (!f->groups) { + of_node_put(child); return -ENOMEM; + } fn = child->name; i = 0; } ret = mxs_pinctrl_parse_group(pdev, child, idxg++, &f->groups[i++]); - if (ret) + if (ret) { + of_node_put(child); return ret; + } } return 0; |