Skip to content

Commit

Permalink
mm/zswap.c: delete an error message for a failed memory allocation in…
Browse files Browse the repository at this point in the history
… zswap_pool_create()

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Markus Elfring <[email protected]>
Cc: Dan Streetman <[email protected]>
Cc: Seth Jennings <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
elfring authored and RahifM committed Jul 9, 2020
1 parent 20b402c commit 0068be4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mm/zswap.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,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));
Expand Down

0 comments on commit 0068be4

Please sign in to comment.