[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <461bd75a-c1bb-e616-c9af-83b969df7344@redhat.com>
Date: Fri, 18 Aug 2017 16:25:42 -0400
From: Joe Lawrence <joe.lawrence@...hat.com>
To: Petr Mladek <pmladek@...e.com>
Cc: live-patching@...r.kernel.org, linux-kernel@...r.kernel.org,
Josh Poimboeuf <jpoimboe@...hat.com>,
Jessica Yu <jeyu@...hat.com>, Jiri Kosina <jikos@...nel.org>,
Miroslav Benes <mbenes@...e.cz>
Subject: Re: [PATCH v4] livepatch: introduce shadow variable API
On 08/17/2017 10:05 AM, Petr Mladek wrote:
> On Mon 2017-08-14 16:02:43, Joe Lawrence wrote:
>> [ ... snip ... ]
>> + /* Allocate a new shadow variable for use inside the lock below */
>> + new_shadow = kzalloc(size + sizeof(*new_shadow), gfp_flags);
>
> We should print an error message when the memory cannot be allocated.
> Otherwise we will return NULL without explanation. It will be
> especially helpful when a caller forgets to check for NULL.
Interesting, I hadn't seen this checkpatch complaint before:
WARNING: Possible unnecessary 'out of memory' message
#416: FILE: kernel/livepatch/shadow.c:143:
+ if (!new_shadow) {
+ pr_err("failed to allocate shadow variable <0x%p, %lu>\n",
Discussion thread:
https://lkml.org/lkml/2014/6/10/382
Think the stack trace that the memory subsystem would emit is good
enough, or would you like to see <obj, id> for debugging purposes?
-- Joe
Powered by blists - more mailing lists