diff options
| author | Joe Lawrence <joe.lawrence@redhat.com> | 2019-02-04 08:56:51 -0500 |
|---|---|---|
| committer | Petr Mladek <pmladek@suse.com> | 2019-02-06 05:00:58 -0500 |
| commit | 86e43f23c17126e32820a1b37d747d06f3056570 (patch) | |
| tree | f1aa71c9381712e7e13e24afe81afa3bfb53add1 /lib/livepatch | |
| parent | ecba29f434a8fa333356d54d2491d174c4aab8de (diff) | |
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>
Diffstat (limited to 'lib/livepatch')
| -rw-r--r-- | lib/livepatch/test_klp_shadow_vars.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
| 44 | 44 | ||
| 45 | sp = kmalloc(sizeof(*sp), GFP_ATOMIC); | 45 | sp = kmalloc(sizeof(*sp), GFP_ATOMIC); |
| 46 | if (!sp) | 46 | if (!sp) |
| 47 | return -1; | 47 | return -ENOMEM; |
| 48 | sp->ptr = ptr; | 48 | sp->ptr = ptr; |
| 49 | sp->id = count++; | 49 | sp->id = count++; |
| 50 | 50 | ||
