Source-Changes-HG archive

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

[src/trunk]: src/sys/kern If we had an error, don't do the debug checks becau...



details:   https://anonhg.NetBSD.org/src/rev/11ad853ef4d7
branches:  trunk
changeset: 820421:11ad853ef4d7
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jan 09 14:25:52 2017 +0000

description:
If we had an error, don't do the debug checks because they will most certainly
fail and we'll panic.

diffstat:

 sys/kern/uipc_mbuf.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r a8edca6d5a5f -r 11ad853ef4d7 sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c      Mon Jan 09 14:15:20 2017 +0000
+++ b/sys/kern/uipc_mbuf.c      Mon Jan 09 14:25:52 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_mbuf.c,v 1.169 2016/10/04 14:13:21 christos Exp $ */
+/*     $NetBSD: uipc_mbuf.c,v 1.170 2017/01/09 14:25:52 christos Exp $ */
 
 /*-
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.169 2016/10/04 14:13:21 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.170 2017/01/09 14:25:52 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -1328,6 +1328,9 @@
        error = m_copyback0(mp, off, len, NULL,
            M_COPYBACK0_PRESERVE|M_COPYBACK0_COW, how);
 
+       if (error)
+               return error;
+
 #if defined(DEBUG)
        int reslen = 0;
        for (struct mbuf *n = *mp; n; n = n->m_next)
@@ -1338,7 +1341,7 @@
                panic("m_makewritable: inconsist");
 #endif /* defined(DEBUG) */
 
-       return error;
+       return 0;
 }
 
 /*



Home | Main Index | Thread Index | Old Index