Skip to content

Commit 9367bb7

Browse files
elfringtorvalds
authored andcommitted
binfmt_flat: delete two error messages for a failed memory allocation 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/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>
1 parent 0547fa5 commit 9367bb7

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎fs/binfmt_flat.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,11 @@ static int decompress_exec(
192192

193193
memset(&strm, 0, sizeof(strm));
194194
strm.workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
195-
if (strm.workspace == NULL) {
196-
pr_debug("no memory for decompress workspace\n");
195+
if (!strm.workspace)
197196
return -ENOMEM;
198-
}
197+
199198
buf = kmalloc(LBUFSIZE, GFP_KERNEL);
200-
if (buf == NULL) {
201-
pr_debug("no memory for read buffer\n");
199+
if (!buf) {
202200
retval = -ENOMEM;
203201
goto out_free;
204202
}

0 commit comments

Comments
 (0)