]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - mm/zswap.c
mm/zswap.c: improve a size determination in zswap_frontswap_init()
[linux.git] / mm / zswap.c
index eedc27894b1013187cc81831e956e4c8344b5176..a6e67633be0392ef09f8c4cae428d257b4a85f9f 100644 (file)
@@ -515,10 +515,8 @@ static struct zswap_pool *zswap_pool_create(char *type, char *compressor)
        }
 
        pool = kzalloc(sizeof(*pool), GFP_KERNEL);
-       if (!pool) {
-               pr_err("pool alloc failed\n");
+       if (!pool)
                return NULL;
-       }
 
        /* unique name for each pool specifically required by zsmalloc */
        snprintf(name, 38, "zswap%x", atomic_inc_return(&zswap_pools_count));
@@ -1158,7 +1156,7 @@ static void zswap_frontswap_init(unsigned type)
 {
        struct zswap_tree *tree;
 
-       tree = kzalloc(sizeof(struct zswap_tree), GFP_KERNEL);
+       tree = kzalloc(sizeof(*tree), GFP_KERNEL);
        if (!tree) {
                pr_err("alloc failed, zswap disabled for swap type %d\n", type);
                return;