binfmt_flat: delete two error messages for a failed memory allocation in decompress_e...
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 8 Sep 2017 23:16:14 +0000 (16:16 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 9 Sep 2017 01:26:50 +0000 (18:26 -0700)
Omit extra messages for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Link: http://lkml.kernel.org/r/f92aac79-b05e-321a-1a19-d38c7159ee9c@users.sourceforge.net
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/binfmt_flat.c

index 604a176df0c2a4f1b9b7ee9a465b3a36a47b3c26..ce6537c50ec140199c6d5b7c6d161afbcf5a8529 100644 (file)
@@ -192,13 +192,11 @@ static int decompress_exec(
 
        memset(&strm, 0, sizeof(strm));
        strm.workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
-       if (strm.workspace == NULL) {
-               pr_debug("no memory for decompress workspace\n");
+       if (!strm.workspace)
                return -ENOMEM;
-       }
+
        buf = kmalloc(LBUFSIZE, GFP_KERNEL);
-       if (buf == NULL) {
-               pr_debug("no memory for read buffer\n");
+       if (!buf) {
                retval = -ENOMEM;
                goto out_free;
        }