bus: qcom: Put child node before return
Subsystems (2)
PATCH 1/1 bus: qcom: Put child node before return
Put child node before return to fix potential reference count leak. Generally, the reference count of child is incremented and decremented automatically in the macro for_each_available_child_of_node() and should be decremented manually if the loop is broken in loop body.
--- drivers/bus/qcom-ebi2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/bus/qcom-ebi2.c +3 -1
@@ -353,8 +353,10 @@ static int qcom_ebi2_probe(struct platform_device *pdev)/* Figure out the chipselect */ ret =of_property_read_u32 (child,"reg" , &csindex); -if (ret) +if (ret) { +of_node_put (child);return ret; + }if (csindex >5 ) { dev_err(dev,
Signature · 1 line
2.17.1
Quoted 7 lines · Pan Bian
Put child node before return to fix potential reference count leak. Generally, the reference count of child is incremented and decremented automatically in the macro
for_each_available_child_of_node()and should be decremented manually if the loop is broken in loop body.Fixes 335a12754808 ("bus: qcom: add EBI2 driver")Signed-off-by Pan Bian <[email protected]>
Please submit this patch for inclusion through the ARM SoC tree.
Yours,
Linus Walleij
Quoted 7 lines · Linus Walleij
Quoted 5 lines · Pan Bian
Put child node before return to fix potential reference count leak. Generally, the reference count of child is incremented and decremented automatically in the macro
for_each_available_child_of_node()and should be decremented manually if the loop is broken in loop body.
Quoted 7 lines
Quoted 2 lines
Fixes 335a12754808 ("bus: qcom: add EBI2 driver")Signed-off-by Pan Bian <[email protected]>Reviewed-by Linus Walleij <[email protected]>Please submit this patch for inclusion through the ARM SoC tree.
Any objections to me picking it in the Qualcomm tree? Or that's what you indirectly meant?
Regards,
Bjorn
Quoted 12 lines · Bjorn Andersson
Quoted 10 lines · Linus Walleij
Quoted 7 lines · Pan Bian
Put child node before return to fix potential reference count leak. Generally, the reference count of child is incremented and decremented automatically in the macro
for_each_available_child_of_node()and should be decremented manually if the loop is broken in loop body.Fixes 335a12754808 ("bus: qcom: add EBI2 driver")Signed-off-by Pan Bian <[email protected]>
Quoted 7 lines
Quoted 4 lines
Reviewed-by Linus Walleij <[email protected]>Please submit this patch for inclusion through the ARM SoC tree.
Any objections to me picking it in the Qualcomm tree? Or that's what you indirectly meant?
Kind-of-sort-of :D
Apply it to the Qualcomm tree!
Yours,
Linus Walleij
This patch was applied to qcom/linux.git (refs/heads/for-next):
Hello:
This patch was applied to qcom/linux.git (refs/heads/for-next):
Quoted 9 lines · On Thu, 21 Jan 2021 03:49:07 -0800 you wrote:
Put child node before return to fix potential reference count leak. Generally, the reference count of child is incremented and decremented automatically in the macro
for_each_available_child_of_node()and should be decremented manually if the loop is broken in loop body.Fixes 335a12754808 ("bus: qcom: add EBI2 driver")Signed-off-by Pan Bian <[email protected]>[...]
Here is the summary with links:
- bus: qcom: Put child node before return
https://git.kernel.org/qcom/c/4f26f0c36fe2
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html