]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/net/wan/dscc4.c: fix error return code
authorJulia Lawall <Julia.Lawall@lip6.fr>
Thu, 16 Aug 2012 21:46:57 +0000 (21:46 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Aug 2012 09:33:21 +0000 (02:33 -0700)
commitc834472ccbc638f42d966d177daabf2928c4a747
tree97096e564b13dd8a91bbf19ec58ee7e29e1133fe
parent2e833a1710d00627f35b2c6dd2d41aea9a34ef3b
drivers/net/wan/dscc4.c: fix error return code

Move up the initialization of rc so that failure of pci_alloc_consistent
returns -ENOMEM as well.

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

// <smpl>
@@
identifier ret;
expression e1,e2;
@@

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

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/dscc4.c