Skip to contentSkip to conversation

ima: Delete an error message for a failed memory allocation in ima_add_digest_entry()

PATCH New SF Markus Elfring 1 participant 1 message Aug 13, 2017

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

PATCH 1/1 ima: Delete an error message for a failed memory allocation in ima_add_digest_entry()

From: Markus Elfring <[email protected]>
Date: Sun, 13 Aug 2017 19:29:11 +0200

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 security/integrity/ima/ima_queue.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
security/integrity/ima/ima_queue.c +2 -3
index a02a86d51102..3b60e72aecb2 100644
@@ -100,10 +100,9 @@ static int ima_add_digest_entry(struct ima_template_entry *entry,
 	unsigned int key;
 
 	qe = kmalloc(sizeof(*qe), GFP_KERNEL);
-	if (qe = NULL) {
-		pr_err("OUT OF MEMORY ERROR creating queue entry\n");
+	if (!qe)
 		return -ENOMEM;
-	}
+
 	qe->entry = entry;
 
 	INIT_LIST_HEAD(&qe->later);
Signature · 1 line
2.14.0