Skip to content

Commit

Permalink
ab8500_btemp: Fix error return code
Browse files Browse the repository at this point in the history
Initialize return variable before exiting on an error path.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
  • Loading branch information
Julia Lawall authored and Anton Vorontsov committed Aug 23, 2012
1 parent 588d4f0 commit 05cdbdb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/power/ab8500_btemp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,7 @@ static int __devinit ab8500_btemp_probe(struct platform_device *pdev)
create_singlethread_workqueue("ab8500_btemp_wq");
if (di->btemp_wq == NULL) {
dev_err(di->dev, "failed to create work queue\n");
ret = -ENOMEM;
goto free_device_info;
}

Expand Down

0 comments on commit 05cdbdb

Please sign in to comment.