Author: glebius
Date: Fri Nov 14 15:44:19 2014
New Revision: 274509
URL: https://svnweb.freebsd.org/changeset/base/274509

Log:
  - Use NULL to compare a pointer.
  - Use KASSERT() instead of panic.
  - Remove useless 'continue', no need to restart cycle here.
  
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/kern/uipc_sockbuf.c

Modified: head/sys/kern/uipc_sockbuf.c
==============================================================================
--- head/sys/kern/uipc_sockbuf.c        Fri Nov 14 15:39:11 2014        
(r274508)
+++ head/sys/kern/uipc_sockbuf.c        Fri Nov 14 15:44:19 2014        
(r274509)
@@ -881,12 +881,10 @@ sbcut_internal(struct sockbuf *sb, int l
        mfree = NULL;
 
        while (len > 0) {
-               if (m == 0) {
-                       if (next == 0)
-                               panic("sbdrop");
+               if (m == NULL) {
+                       KASSERT(next, ("%s: no next, len %d", __func__, len));
                        m = next;
                        next = m->m_nextpkt;
-                       continue;
                }
                if (m->m_len > len) {
                        m->m_len -= len;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to