From: Joe Lawrence Date: Mon, 4 Feb 2019 13:56:51 +0000 (+0100) Subject: livepatch: return -ENOMEM on ptr_id() allocation failure X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=86e43f23c17126e32820a1b37d747d06f3056570;p=linux.git livepatch: return -ENOMEM on ptr_id() allocation failure 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 Acked-by: Miroslav Benes Signed-off-by: Petr Mladek --- diff --git a/lib/livepatch/test_klp_shadow_vars.c b/lib/livepatch/test_klp_shadow_vars.c index 02f892f941dca..f5441c193166d 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++;