[media] drivers/media/usb/gspca/cpia1.c: fix error return code
authorPeter Senna Tschudin <peter.senna@gmail.com>
Thu, 6 Sep 2012 15:24:01 +0000 (12:24 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 13 Sep 2012 20:42:16 +0000 (17:42 -0300)
commit8c96f0a207bedb6f06089fde9adc7abe8136a087
tree0b1c629b9f196b27ac295d9f500c8cfe536950ef
parent50c457a950ac06b4c461ed36fdb4a84c0d27a82b
[media] drivers/media/usb/gspca/cpia1.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: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/gspca/cpia1.c