Skip to content

Commit

Permalink
ALSA: sound/atmel/abdac.c: fix error return code
Browse files Browse the repository at this point in the history
Initialize retval before returning from a failed call to ioremap.

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 <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
JuliaLawall authored and tiwai committed Aug 20, 2012
1 parent 8513915 commit aaf265c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sound/atmel/abdac.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ static int __devinit atmel_abdac_probe(struct platform_device *pdev)
dac->regs = ioremap(regs->start, resource_size(regs));
if (!dac->regs) {
dev_dbg(&pdev->dev, "could not remap register memory\n");
retval = -ENOMEM;
goto out_free_card;
}

Expand Down

0 comments on commit aaf265c

Please sign in to comment.