drivers/virtio/virtio_pci.c: fix error return code
authorPeter Senna Tschudin <peter.senna@gmail.com>
Mon, 17 Sep 2012 17:31:17 +0000 (19:31 +0200)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 28 Sep 2012 05:35:16 +0000 (15:05 +0930)
commit74a74b376c997645b32a4fdf8e76705a00ae097a
treef84ebd0e06017135dc657e9133401db4bca57941
parent5543a6ac31eb4bfd8d938db6b234ce833d14e04e
drivers/virtio/virtio_pci.c: fix error return code

Convert a nonnegative 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>
(
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: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/virtio/virtio_pci.c