From: Markus Elfring Date: Thu, 6 Jul 2017 22:40:40 +0000 (-0700) Subject: mm/zswap.c: delete an error message for a failed memory allocation in zswap_dstmem_pr... X-Git-Tag: v4.13-rc1~121^2~8 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2b2695f5fdf185092a72c81ca2c09ed1b9b37416;p=karo-tx-linux.git mm/zswap.c: delete an error message for a failed memory allocation in 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 Cc: Dan Streetman Cc: Seth Jennings Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/zswap.c b/mm/zswap.c index a6e67633be03..d39581a076c3 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -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; }