mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
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 <joe.lawrence@redhat.com> Acked-by: Miroslav Benes <mbenes@suse.cz> Signed-off-by: Petr Mladek <pmladek@suse.com>
This commit is contained in:
parent
ecba29f434
commit
86e43f23c1
@ -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++;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user