Whamcloud - gitweb
LU-224 Move fail_loc handling from lustre to libcfs
[fs/lustre-release.git] / libcfs / libcfs / hash.c
index db30f8c..1ea6bf4 100644 (file)
@@ -1157,7 +1157,7 @@ CFS_EXPORT_SYMBOL(cfs_hash_getref);
 
 void cfs_hash_putref(cfs_hash_t *hs)
 {
-        if (cfs_atomic_dec_and_test(&hs->hs_refcount))
+        if (hs && cfs_atomic_dec_and_test(&hs->hs_refcount))
                 cfs_hash_destroy(hs);
 }
 CFS_EXPORT_SYMBOL(cfs_hash_putref);