- Use M_ZERO
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 28 Dec 2007 11:37:08 +0000 (11:37 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 28 Dec 2007 11:37:08 +0000 (11:37 +0000)
- Minor cleanup

sys/netinet/in.c

index 4e6157d..e2c360d 100644 (file)
@@ -32,7 +32,7 @@
  *
  *     @(#)in.c        8.4 (Berkeley) 1/9/95
  * $FreeBSD: src/sys/netinet/in.c,v 1.44.2.14 2002/11/08 00:45:50 suz Exp $
- * $DragonFly: src/sys/netinet/in.c,v 1.21 2007/11/16 05:07:36 sephe Exp $
+ * $DragonFly: src/sys/netinet/in.c,v 1.22 2007/12/28 11:37:08 sephe Exp $
  */
 
 #include "opt_bootp.h"
@@ -266,11 +266,9 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
                if (ifp == 0)
                        return (EADDRNOTAVAIL);
                if (ia == (struct in_ifaddr *)0) {
-                       ia = (struct in_ifaddr *)
-                               kmalloc(sizeof *ia, M_IFADDR, M_WAITOK);
-                       if (ia == (struct in_ifaddr *)NULL)
+                       ia = kmalloc(sizeof *ia, M_IFADDR, M_WAITOK | M_ZERO);
+                       if (ia == NULL)
                                return (ENOBUFS);
-                       bzero(ia, sizeof *ia);
                        /*
                         * Protect from NETISR_IP traversing address list
                         * while we're modifying it.