frontswap: don't call ->init if no ops are registered
[linux-2.6-block.git] / mm / frontswap.c
index 1a97610308cbc28a8b16b6eeb16bd978a71d1be7..279e55b4ed8739f51e49959854555fedb536ddf2 100644 (file)
@@ -125,6 +125,9 @@ void frontswap_init(unsigned type, unsigned long *map)
         * p->frontswap set to something valid to work properly.
         */
        frontswap_map_set(sis, map);
+
+       if (!frontswap_enabled())
+               return;
        frontswap_ops->init(type);
 }