From: Julia Lawall Date: Sun, 19 Aug 2012 07:02:58 +0000 (+0200) Subject: ALSA: sound/atmel/abdac.c: fix error return code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aaf265c22e48f10c94ad04d23b6ab0c88f554d35;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ALSA: sound/atmel/abdac.c: fix error return code 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/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Julia Lawall Signed-off-by: Takashi Iwai --- diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c index 98554f4882b7..277ebce23a45 100644 --- a/sound/atmel/abdac.c +++ b/sound/atmel/abdac.c @@ -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; }