Whamcloud - gitweb
A little debugging I've been running in my tree for a long time.
authoradilger <adilger>
Mon, 21 Oct 2002 21:31:04 +0000 (21:31 +0000)
committeradilger <adilger>
Mon, 21 Oct 2002 21:31:04 +0000 (21:31 +0000)
It caught a couple of minor bugs, and should prevent more in the future.

lustre/include/linux/obd_support.h

index 3c11ffd..724a8e2 100644 (file)
@@ -164,10 +164,12 @@ do {                                                                    \
 #define OBD_FREE(ptr, size)                                             \
 do {                                                                    \
         int s = (size);                                                 \
+        LASSERT(ptr);                                                   \
         kfree((ptr));                                                   \
         obd_memory -= s;                                                \
         CDEBUG(D_MALLOC, "kfreed '" #ptr "': %d at %p (tot %ld).\n",    \
                s, (ptr), obd_memory);                                   \
+        (ptr) = (void *)0xdeadbeef;                                     \
 } while (0)
 
 #endif