[PATCH] phy: qualcomm: phy-qcom-qmp: Add of_node_put() before return

2019-08-08 Thread Nishka Dasgupta
Each iteration of for_each_available_child_of_node() puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence create a new label, err_node_put, that puts the previous node (child) before returning the required value. Also

Re: [PATCH] phy: qualcomm: phy-qcom-qmp: Add of_node_put() before return

2019-08-05 Thread Markus Elfring
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c > @@ -2094,6 +2094,7 @@ static int qcom_qmp_phy_probe(struct platform_device > *pdev) > dev_err(dev, "failed to create lane%d phy, %d\n", > id, ret); > pm_runtime_disable(dev); >

Re: [PATCH] phy: qualcomm: phy-qcom-qmp: Add of_node_put() before return

2019-08-05 Thread Vivek Gautam
On Sun, Aug 4, 2019 at 9:54 PM Nishka Dasgupta wrote: > > Each iteration of for_each_available_child_of_node puts the previous > node, but in the case of a return from the middle of the loop, there is > no put, thus causing a memory leak. Hence add an of_node_put before the > return in two

[PATCH] phy: qualcomm: phy-qcom-qmp: Add of_node_put() before return

2019-08-04 Thread Nishka Dasgupta
Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return in two places. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta