]> git.baikalelectronics.ru Git - kernel.git/commit
livepatch: check kzalloc return values
authorNicholas Mc Guire <hofrat@osadl.org>
Fri, 14 Dec 2018 16:56:10 +0000 (17:56 +0100)
committerJiri Kosina <jkosina@suse.cz>
Tue, 18 Dec 2018 09:23:07 +0000 (10:23 +0100)
commit20cf59aea8af5c9d52135c93a218abb9d62167fa
tree4bafe61acde2fdb571e39eea272b3ca09b3be520
parent45fd74e9dd136060b5b006244a80fe46dc235af4
livepatch: check kzalloc return values

kzalloc() return should always be checked - notably in example code
where this may be seen as reference. On failure of allocation in
livepatch_fix1_dummy_alloc() respectively dummy_alloc() previous
allocation is freed (thanks to Petr Mladek <pmladek@suse.com> for
catching this) and NULL returned.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Fixes: a65572bd973a ("livepatch: introduce shadow variable API")
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
samples/livepatch/livepatch-shadow-fix1.c
samples/livepatch/livepatch-shadow-mod.c