Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/dtv dtv_demux_write: make sure to unlock muted in al...



details:   https://anonhg.NetBSD.org/src/rev/007e83912326
branches:  trunk
changeset: 767264:007e83912326
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Jul 13 22:50:24 2011 +0000

description:
dtv_demux_write: make sure to unlock muted in all error paths

diffstat:

 sys/dev/dtv/dtv_demux.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 77308be9cb7a -r 007e83912326 sys/dev/dtv/dtv_demux.c
--- a/sys/dev/dtv/dtv_demux.c   Wed Jul 13 22:50:11 2011 +0000
+++ b/sys/dev/dtv/dtv_demux.c   Wed Jul 13 22:50:24 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtv_demux.c,v 1.1 2011/07/13 22:43:04 jmcneill Exp $ */
+/* $NetBSD: dtv_demux.c,v 1.2 2011/07/13 22:50:24 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dtv_demux.c,v 1.1 2011/07/13 22:43:04 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dtv_demux.c,v 1.2 2011/07/13 22:50:24 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -449,7 +449,7 @@
 
        if (TS_HAS_PUSI(tspkt)) {
                if (brem < 16)
-                       return 0;
+                       goto done;
 
                section_length = ((p[1] & 0xf) << 8) | p[2];
 
@@ -477,7 +477,7 @@
 
        avail = min(sec->sec_length - sec->sec_bytesused, brem);
        if (avail < 0)
-               return 0;
+               goto done;
 
        memcpy(&sec->sec_buf[sec->sec_bytesused], p, avail);
        sec->sec_bytesused += avail;



Home | Main Index | Thread Index | Old Index