Skip to content

Commit

Permalink
livepatch: return -ENOMEM on ptr_id() allocation failure
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Miroslav Benes <[email protected]>
Signed-off-by: Petr Mladek <[email protected]>
  • Loading branch information
joe-lawrence authored and pmladek committed Feb 6, 2019
1 parent ecba29f commit 86e43f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/livepatch/test_klp_shadow_vars.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;

Expand Down

0 comments on commit 86e43f2

Please sign in to comment.