Skip to content

Commit

Permalink
[media] drivers/media/dvb/ttpci/av7110_av.c: Add missing error handli…
Browse files Browse the repository at this point in the history
…ng code

Extend the error handling code with operations found in other nearby error
handling code.

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

// <smpl>
@r exists@
@r@
statement S1,S2,S3;
constant C1,C2,C3;
@@

*if (...)
 {... S1 return -C1;}
...
*if (...)
 {... when != S1
    return -C2;}
...
*if (...)
 {... S1 return -C3;}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Julia Lawall authored and Mauro Carvalho Chehab committed Oct 21, 2010
1 parent bdd1751 commit 92d0d66
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/media/dvb/ttpci/av7110_av.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,11 @@ int av7110_pes_play(void *dest, struct dvb_ringbuffer *buf, int dlen)
return -1;
}
while (1) {
if ((len = dvb_ringbuffer_avail(buf)) < 6)
len = dvb_ringbuffer_avail(buf);
if (len < 6) {
wake_up(&buf->queue);
return -1;
}
sync = DVB_RINGBUFFER_PEEK(buf, 0) << 24;
sync |= DVB_RINGBUFFER_PEEK(buf, 1) << 16;
sync |= DVB_RINGBUFFER_PEEK(buf, 2) << 8;
Expand Down

0 comments on commit 92d0d66

Please sign in to comment.