Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1710573 > unrolled thread

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

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-08-13 19:40 +0200
Last post2017-08-13 19:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] ima: Delete an error message for a failed memory allocation  in ima_add_digest_entry() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-13 19:40 +0200

#1710573 — [PATCH] ima: Delete an error message for a failed memory allocation in ima_add_digest_entry()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-08-13 19:40 +0200
Subject[PATCH] ima: Delete an error message for a failed memory allocation in ima_add_digest_entry()
Message-ID<ue51M-1Aw-7@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
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.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 security/integrity/ima/ima_queue.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c
index a02a86d51102..3b60e72aecb2 100644
--- a/security/integrity/ima/ima_queue.c
+++ b/security/integrity/ima/ima_queue.c
@@ -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);
-- 
2.14.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web