ASoC: bcm: add missing call to of_node_put()
Subsystems (3)
PATCH 1/1 ASoC: bcm: add missing call to of_node_put()
In one of the error paths of the for_each_child_of_node() loop, add missing call to of_node_put().
Fix the following coccicheck warning:
./sound/soc/bcm/cygnus-ssp.c:1346:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 1352.
--- sound/soc/bcm/cygnus-ssp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/bcm/cygnus-ssp.c +3 -1
@@ -1348,8 +1348,10 @@ static int cygnus_ssp_probe(struct platform_device *pdev) &cygnus_ssp_dai[active_port_count]);/* negative is err, 0 is active and good, 1 is disabled */ -if (err <0 ) +if (err <0 ) { +of_node_put (child_node);return err; + }else if (!err) {dev_dbg (dev,"Activating DAI: %s\n" , cygnus_ssp_dai[active_port_count].name);
Signature · 1 line
1.8.3.1
Hi Yang,
Quoted 19 lines · Yang Li
In one of the error paths of the
for_each_child_of_node()loop, add missing call toof_node_put().Fix the following coccicheck warning:
./sound/soc/bcm/cygnus-ssp.c:1346:1-33: WARNING: Function "for_each_available_child_of_node" should haveof_node_put()before return around line 1352.Reported-by Abaci Robot <[email protected]>Signed-off-by Yang Li <[email protected]>--- sound/soc/bcm/cygnus-ssp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)sound/soc/bcm/cygnus-ssp.c +0
-0
sound/soc/bcm/cygnus-ssp.c static int cygnus_ssp_probe(struct platform_device *pdev) · line 1352
Quoted 6 lines
sound/soc/bcm/cygnus-ssp.c +2
-1@@ -1348,8 +1348,10 @@ static int cygnus_ssp_probe(struct platform_device *pdev) &cygnus_ssp_dai[active_port_count]);/* negative is err, 0 is active and good, 1 is disabled */ -if (err <0 ) +if (err <0 ) { +of_node_put (child_node);
If such is needed in probe what about the other child_nodes in for_each_child_of_node loop that have already been parsed and succeeded. Do they need additional cleanup as well?
Quoted 6 lines
sound/soc/bcm/cygnus-ssp.c +1
-0return err; + }else if (!err) {dev_dbg (dev,"Activating DAI: %s\n" , cygnus_ssp_dai[active_port_count].name);