Skip to content

Commit

Permalink
[media] drivers/media/usb/gspca/cpia1.c: fix error return code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Senna Tschudin authored and Mauro Carvalho Chehab committed Sep 13, 2012
1 parent 50c457a commit 8c96f0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/usb/gspca/cpia1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 8c96f0a

Please sign in to comment.