Skip to content

Commit

Permalink
kernel/module: Delete an error message for a failed memory allocation…
Browse files Browse the repository at this point in the history
… in add_module_usage()

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>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
  • Loading branch information
Markus Elfring authored and Jessica Yu committed Oct 19, 2017
1 parent 33d930e commit 9ad0457
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions kernel/module.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 9ad0457

Please sign in to comment.