Author: glebius
Date: Fri Mar 15 10:17:24 2013
New Revision: 248316
URL: http://svnweb.freebsd.org/changeset/base/248316

Log:
  - Use m_get2() instead of hand allocating.
  - No need for u_int cast here.
  
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/uipc_syscalls.c
==============================================================================
--- head/sys/kern/uipc_syscalls.c       Fri Mar 15 10:15:07 2013        
(r248315)
+++ head/sys/kern/uipc_syscalls.c       Fri Mar 15 10:17:24 2013        
(r248316)
@@ -1701,18 +1701,16 @@ sockargs(mp, buf, buflen, type)
        struct mbuf *m;
        int error;
 
-       if ((u_int)buflen > MLEN) {
+       if (buflen > MLEN) {
 #ifdef COMPAT_OLDSOCK
-               if (type == MT_SONAME && (u_int)buflen <= 112)
+               if (type == MT_SONAME && buflen <= 112)
                        buflen = MLEN;          /* unix domain compat. hack */
                else
 #endif
-                       if ((u_int)buflen > MCLBYTES)
+                       if (buflen > MCLBYTES)
                                return (EINVAL);
        }
-       m = m_get(M_WAITOK, type);
-       if ((u_int)buflen > MLEN)
-               MCLGET(m, M_WAITOK);
+       m = m_get2(buflen, M_WAITOK, type, 0);
        m->m_len = buflen;
        error = copyin(buf, mtod(m, caddr_t), (u_int)buflen);
        if (error)
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to