Skip to contentSkip to conversation

binfmt_flat: Delete two error messages for a failed memory allocation in decompress_exec()

PATCH Applied SF Markus Elfring 1 participant 1 message Aug 21, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 binfmt_flat: Delete two error messages for a failed memory allocation in decompress_exec()

From: Markus Elfring <[email protected]>
Date: Mon, 21 Aug 2017 08:43:50 +0200

Omit extra messages for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 fs/binfmt_flat.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
fs/binfmt_flat.c +3 -5
index 604a176df0c2..ce6537c50ec1 100644
@@ -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;
 	}
Signature · 1 line
2.14.0