mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
livepatch/sample: Use the right type for the leaking data pointer
The "leak" pointer, in the sample of shadow variable API, is allocated as sizeof(int). Let's help developers and static analyzers with understanding the code by using the appropriate pointer type. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Petr Mladek <pmladek@suse.com> Reviewed-by: Joe Lawrence <joe.lawrence@redhat.com> Acked-by: Miroslav Benes <mbenes@suse.cz> Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
f838767555
commit
8f6b88662c
3 changed files with 10 additions and 10 deletions
|
@ -59,7 +59,7 @@ static bool livepatch_fix2_dummy_check(struct dummy *d, unsigned long jiffies)
|
|||
static void livepatch_fix2_dummy_leak_dtor(void *obj, void *shadow_data)
|
||||
{
|
||||
void *d = obj;
|
||||
void **shadow_leak = shadow_data;
|
||||
int **shadow_leak = shadow_data;
|
||||
|
||||
kfree(*shadow_leak);
|
||||
pr_info("%s: dummy @ %p, prevented leak @ %p\n",
|
||||
|
@ -68,7 +68,7 @@ static void livepatch_fix2_dummy_leak_dtor(void *obj, void *shadow_data)
|
|||
|
||||
static void livepatch_fix2_dummy_free(struct dummy *d)
|
||||
{
|
||||
void **shadow_leak;
|
||||
int **shadow_leak;
|
||||
int *shadow_count;
|
||||
|
||||
/* Patch: copy the memory leak patch from the fix1 module. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue