[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)
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

index 2499a88..b3ba47d 100644 (file)
@@ -751,7 +751,7 @@ static int goto_high_power(struct gspca_dev *gspca_dev)
        if (signal_pending(current))
                return -EINTR;
 
-       do_command(gspca_dev, CPIA_COMMAND_GetCameraStatus, 0, 0, 0, 0);
+       ret = do_command(gspca_dev, CPIA_COMMAND_GetCameraStatus, 0, 0, 0, 0);
        if (ret)
                return ret;