mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Lawrence <joe.lawrence@redhat.com>
To: Petr Mladek <pmladek@suse.com>
Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Jessica Yu <jeyu@redhat.com>, Jiri Kosina <jikos@kernel.org>,
	Miroslav Benes <mbenes@suse.cz>
Subject: Re: [PATCH v4] livepatch: introduce shadow variable API
Date: Fri, 18 Aug 2017 16:25:42 -0400	[thread overview]
Message-ID: <461bd75a-c1bb-e616-c9af-83b969df7344@redhat.com> (raw)
In-Reply-To: <20170817140545.GF601@pathway.suse.cz>

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

  parent reply	other threads:[~2017-08-18 20:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-14 20:02 [PATCH v4] livepatch: shadow variables Joe Lawrence
2017-08-14 20:02 ` [PATCH v4] livepatch: introduce shadow variable API Joe Lawrence
2017-08-15 13:59   ` Josh Poimboeuf
2017-08-16 12:43   ` Miroslav Benes
2017-08-16 13:40     ` Joe Lawrence
2017-08-31 12:45       ` Miroslav Benes
2017-08-17 14:05   ` Petr Mladek
2017-08-17 16:01     ` Joe Lawrence
2017-08-17 16:28       ` Josh Poimboeuf
2017-08-18  9:42       ` Petr Mladek
2017-08-18 19:04         ` Josh Poimboeuf
2017-08-18 13:46     ` Joe Lawrence
2017-08-18 16:18       ` Petr Mladek
2017-08-18 20:25     ` Joe Lawrence [this message]
2017-08-21 11:24       ` Petr Mladek
2017-08-18 13:44   ` Nicolai Stange
2017-08-18 14:04     ` Petr Mladek
2017-08-18 14:19       ` Joe Lawrence
2017-08-18 14:46         ` Nicolai Stange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=461bd75a-c1bb-e616-c9af-83b969df7344@redhat.com \
    --to=joe.lawrence@redhat.com \
    --cc=jeyu@redhat.com \
    --cc=jikos@kernel.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome