diff options
Diffstat (limited to 'samples/livepatch/livepatch-shadow-fix1.c')
-rw-r--r-- | samples/livepatch/livepatch-shadow-fix1.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/samples/livepatch/livepatch-shadow-fix1.c b/samples/livepatch/livepatch-shadow-fix1.c index 49b13553eaae..e8f1bd6b29b1 100644 --- a/samples/livepatch/livepatch-shadow-fix1.c +++ b/samples/livepatch/livepatch-shadow-fix1.c | |||
@@ -89,6 +89,11 @@ struct dummy *livepatch_fix1_dummy_alloc(void) | |||
89 | * pointer to handle resource release. | 89 | * pointer to handle resource release. |
90 | */ | 90 | */ |
91 | leak = kzalloc(sizeof(int), GFP_KERNEL); | 91 | leak = kzalloc(sizeof(int), GFP_KERNEL); |
92 | if (!leak) { | ||
93 | kfree(d); | ||
94 | return NULL; | ||
95 | } | ||
96 | |||
92 | klp_shadow_alloc(d, SV_LEAK, sizeof(leak), GFP_KERNEL, | 97 | klp_shadow_alloc(d, SV_LEAK, sizeof(leak), GFP_KERNEL, |
93 | shadow_leak_ctor, leak); | 98 | shadow_leak_ctor, leak); |
94 | 99 | ||