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_dstmem_prepare()

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/bae25b04-2ce2-7137-a71c-50d7b4f06431@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 9cd1f70 commit 2b2695f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mm/zswap.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,9 @@ static int zswap_dstmem_prepare(unsigned int cpu)
u8 *dst;

dst = kmalloc_node(PAGE_SIZE * 2, GFP_KERNEL, cpu_to_node(cpu));
if (!dst) {
pr_err("can't allocate compressor buffer\n");
if (!dst)
return -ENOMEM;
}

per_cpu(zswap_dstmem, cpu) = dst;
return 0;
}
Expand Down

0 comments on commit 2b2695f

Please sign in to comment.