Skip to content

Commit f716168

Browse files
Julia Lawalldavem330
authored andcommitted
drivers/atm/iphase.c: fix error return code
Convert a 0 error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ identifier ret; expression e,e1,e2,e3,e4,x; @@ ( if (\(ret != 0\|ret < 0\) || ...) { ... return ...; } | ret = 0 ) ... when != ret = e1 *x = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\|ioremap\|ioremap_nocache\|devm_ioremap\|devm_ioremap_nocache\)(...); ... when != x = e2 when != ret = e3 *if (x == NULL || ...) { ... when != ret = e4 * return ret; } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 8e7dfbc commit f716168

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/atm/iphase.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,7 @@ static int __devinit ia_init(struct atm_dev *dev)
23622362
{
23632363
printk(DEV_LABEL " (itf %d): can't set up page mapping\n",
23642364
dev->number);
2365-
return error;
2365+
return -ENOMEM;
23662366
}
23672367
IF_INIT(printk(DEV_LABEL " (itf %d): rev.%d,base=%p,irq=%d\n",
23682368
dev->number, iadev->pci->revision, base, iadev->irq);)

0 commit comments

Comments
 (0)