public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel/module: Delete an error message for a failed memory allocation in add_module_usage()
@ 2017-10-06 15:12 SF Markus Elfring
  2017-10-19  9:29 ` Jessica Yu
  2017-10-19 11:08 ` Jessica Yu
  0 siblings, 2 replies; 12+ messages in thread
From: SF Markus Elfring @ 2017-10-06 15:12 UTC (permalink / raw)
  To: kernel-janitors, Jessica Yu, Rusty Russell; +Cc: LKML

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 6 Oct 2017 16:27:26 +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>
---
 kernel/module.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index de66ec825992..07ef44767245 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -837,10 +837,8 @@ static int add_module_usage(struct module *a, struct module *b)
 
 	pr_debug("Allocating new usage for %s.\n", a->name);
 	use = kmalloc(sizeof(*use), GFP_ATOMIC);
-	if (!use) {
-		pr_warn("%s: out of memory loading\n", a->name);
+	if (!use)
 		return -ENOMEM;
-	}
 
 	use->source = a;
 	use->target = b;
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-10-19 18:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-06 15:12 [PATCH] kernel/module: Delete an error message for a failed memory allocation in add_module_usage() SF Markus Elfring
2017-10-19  9:29 ` Jessica Yu
2017-10-19 10:30   ` Dan Carpenter
2017-10-19 11:02     ` Jessica Yu
2017-10-19 11:12       ` SF Markus Elfring
2017-10-19 10:42   ` SF Markus Elfring
2017-10-19 11:08 ` Jessica Yu
2017-10-19 11:18   ` SF Markus Elfring
2017-10-19 11:29     ` Joe Perches
2017-10-19 11:35       ` SF Markus Elfring
2017-10-19 11:45         ` Joe Perches
2017-10-19 18:56           ` SF Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox