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/2345aabc-ae98-1d31-afba-40a02c5baf3d@users.sourceforge.net
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Seth Jennings <sjenning@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Markus Elfring authored and Linus Torvalds committed Jul 6, 2017
1 parent 155b5f8 commit f4ae0ce
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 @@ -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));
Expand Down

0 comments on commit f4ae0ce

Please sign in to comment.