projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
livepatch: check kzalloc return values
[linux-2.6-microblaze.git]
/
samples
/
livepatch
/
livepatch-shadow-mod.c
diff --git
a/samples/livepatch/livepatch-shadow-mod.c
b/samples/livepatch/livepatch-shadow-mod.c
index
4c54b25
..
4aa8a88
100644
(file)
--- a/
samples/livepatch/livepatch-shadow-mod.c
+++ b/
samples/livepatch/livepatch-shadow-mod.c
@@
-118,6
+118,10
@@
noinline struct dummy *dummy_alloc(void)
/* Oops, forgot to save leak! */
leak = kzalloc(sizeof(int), GFP_KERNEL);
+ if (!leak) {
+ kfree(d);
+ return NULL;
+ }
pr_info("%s: dummy @ %p, expires @ %lx\n",
__func__, d, d->jiffies_expire);