Skip to content

Commit

Permalink
binfmt_flat: delete two error messages for a failed memory allocation…
Browse files Browse the repository at this point in the history
… in decompress_exec()

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/[email protected]
Signed-off-by: Markus Elfring <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
elfring authored and torvalds committed Sep 9, 2017
1 parent 0547fa5 commit 9367bb7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions fs/binfmt_flat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9367bb7

Please sign in to comment.