Whamcloud - gitweb
b=22860 lnet_msg_alloc does double memset to zero
authorRahul Deshmukh <Rahul.Deshmukh@sun.com>
Thu, 7 Oct 2010 13:01:04 +0000 (18:31 +0530)
committerVitaly Fertman <vitaly.fertman@sun.com>
Thu, 7 Oct 2010 22:09:12 +0000 (02:09 +0400)
i=andreas
i=liang

lnet/include/lnet/lib-lnet.h

index 1e6b72f..33f780d 100644 (file)
@@ -337,13 +337,13 @@ lnet_msg_alloc(void)
 
         LIBCFS_ALLOC(msg, sizeof(*msg));
 
-        if (msg != NULL) {
-                /* NULL pointers, clear flags etc */
-                memset (msg, 0, sizeof (*msg));
+        /* no need to zero, LIBCFS_ALLOC does for us */
+
 #ifdef CRAY_XT3
+        if (msg != NULL) {
                 msg->msg_ev.uid = LNET_UID_ANY;
-#endif
         }
+#endif
         return (msg);
 }