From: Julia Lawall Date: Sat, 2 Oct 2010 13:59:15 +0000 (-0300) Subject: [media] drivers/media/dvb/ttpci/av7110_av.c: Add missing error handling code X-Git-Tag: v3.0~2969^2~185 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92d0d66c1515c8ee3b700ab3d610587c71fe497f;p=platform%2Fkernel%2Flinux-amlogic.git [media] drivers/media/dvb/ttpci/av7110_av.c: Add missing error handling 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/) // @r exists@ @r@ statement S1,S2,S3; constant C1,C2,C3; @@ *if (...) {... S1 return -C1;} ... *if (...) {... when != S1 return -C2;} ... *if (...) {... S1 return -C3;} // Signed-off-by: Julia Lawall Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/ttpci/av7110_av.c b/drivers/media/dvb/ttpci/av7110_av.c index 13efba9..4a31cf6 100644 --- a/drivers/media/dvb/ttpci/av7110_av.c +++ b/drivers/media/dvb/ttpci/av7110_av.c @@ -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;