Re: kernel/module: Delete an error message for a failed memory allocation in add_module_usage()

From: SF Markus Elfring
Date: Thu Oct 19 2017 - 06:42:43 EST


>> @@ -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;
>> -ÂÂÂ }
>
> IMO this is removing useful information.

How do you think about to clarify the circumstances any further?


> Although stack traces are generated on alloc failures,

Do you ever want to switch them off for special use cases?


> the extra print also tells us which module we were trying to load
> at the time the memory allocation failed.

Can a default allocation failure report provide the same information already?

Regards,
Markus