diff options
Diffstat (limited to 'samples/livepatch/livepatch-shadow-fix2.c')
-rw-r--r-- | samples/livepatch/livepatch-shadow-fix2.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/samples/livepatch/livepatch-shadow-fix2.c b/samples/livepatch/livepatch-shadow-fix2.c index ff9948f0ec00..d6c62844dc15 100644 --- a/samples/livepatch/livepatch-shadow-fix2.c +++ b/samples/livepatch/livepatch-shadow-fix2.c | |||
@@ -53,17 +53,15 @@ struct dummy { | |||
53 | bool livepatch_fix2_dummy_check(struct dummy *d, unsigned long jiffies) | 53 | bool livepatch_fix2_dummy_check(struct dummy *d, unsigned long jiffies) |
54 | { | 54 | { |
55 | int *shadow_count; | 55 | int *shadow_count; |
56 | int count; | ||
57 | 56 | ||
58 | /* | 57 | /* |
59 | * Patch: handle in-flight dummy structures, if they do not | 58 | * Patch: handle in-flight dummy structures, if they do not |
60 | * already have a SV_COUNTER shadow variable, then attach a | 59 | * already have a SV_COUNTER shadow variable, then attach a |
61 | * new one. | 60 | * new one. |
62 | */ | 61 | */ |
63 | count = 0; | ||
64 | shadow_count = klp_shadow_get_or_alloc(d, SV_COUNTER, | 62 | shadow_count = klp_shadow_get_or_alloc(d, SV_COUNTER, |
65 | &count, sizeof(count), | 63 | sizeof(*shadow_count), GFP_NOWAIT, |
66 | GFP_NOWAIT); | 64 | NULL, NULL); |
67 | if (shadow_count) | 65 | if (shadow_count) |
68 | *shadow_count += 1; | 66 | *shadow_count += 1; |
69 | 67 | ||