public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Jiri Kosina <jikos@kernel.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Miroslav Benes <mbenes@suse.cz>
Cc: Jason Baron <jbaron@akamai.com>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	Evgenii Shatokhin <eshatokhin@virtuozzo.com>,
	live-patching@vger.kernel.org, linux-kernel@vger.kernel.org,
	Petr Mladek <pmladek@suse.com>
Subject: [PATCH v2 2/4] livepatch: return -ENOMEM on ptr_id() allocation failure
Date: Mon,  4 Feb 2019 14:56:51 +0100	[thread overview]
Message-ID: <20190204135653.31406-3-pmladek@suse.com> (raw)
In-Reply-To: <20190204135653.31406-1-pmladek@suse.com>

From: Joe Lawrence <joe.lawrence@redhat.com>

Fixes the following smatch warning:

  lib/livepatch/test_klp_shadow_vars.c:47 ptr_id() warn: returning -1 instead of -ENOMEM is sloppy

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
---
 lib/livepatch/test_klp_shadow_vars.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/livepatch/test_klp_shadow_vars.c b/lib/livepatch/test_klp_shadow_vars.c
index 02f892f941dc..f5441c193166 100644
--- a/lib/livepatch/test_klp_shadow_vars.c
+++ b/lib/livepatch/test_klp_shadow_vars.c
@@ -44,7 +44,7 @@ static int ptr_id(void *ptr)
 
 	sp = kmalloc(sizeof(*sp), GFP_ATOMIC);
 	if (!sp)
-		return -1;
+		return -ENOMEM;
 	sp->ptr = ptr;
 	sp->id = count++;
 
-- 
2.13.7


  parent reply	other threads:[~2019-02-04 13:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-04 13:56 [PATCH v2 0/4] livepatch: Followup changes for the atomic replace patchset Petr Mladek
2019-02-04 13:56 ` [PATCH v2 1/4] livepatch: Introduce klp_for_each_patch macro Petr Mladek
2019-02-04 13:56 ` Petr Mladek [this message]
2019-02-05 13:26   ` [PATCH v2 2/4] livepatch: return -ENOMEM on ptr_id() allocation failure Miroslav Benes
2019-02-04 13:56 ` [PATCH v2 3/4] livepatch: Proper error handling in the shadow variables selftest Petr Mladek
2019-02-05 14:18   ` Miroslav Benes
2019-02-05 21:17   ` Joe Lawrence
2019-02-04 13:56 ` [PATCH v2 4/4] livepatch: Module coming and going callbacks can proceed with all listed patches Petr Mladek
2019-02-06 10:29 ` [PATCH v2 0/4] livepatch: Followup changes for the atomic replace patchset Petr Mladek
2019-02-06 15:22 ` Josh Poimboeuf

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=20190204135653.31406-3-pmladek@suse.com \
    --to=pmladek@suse.com \
    --cc=eshatokhin@virtuozzo.com \
    --cc=jbaron@akamai.com \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    /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