Skip to content

Commit bef8e2d

Browse files
tititiou36paulburton
authored andcommitted
MIPS: VPE: Fix a double free and a memory leak in 'release_vpe()'
Pointer on the memory allocated by 'alloc_progmem()' is stored in 'v->load_addr'. So this is this memory that should be freed by 'release_progmem()'. 'release_progmem()' is only a call to 'kfree()'. With the current code, there is both a double free and a memory leak. Fix it by passing the correct pointer to 'release_progmem()'. Fixes: e01402b ("More AP / SP bits for the 34K, the Malta bits and things. Still wants") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Paul Burton <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected]
1 parent 97e914b commit bef8e2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/mips/kernel/vpe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void release_vpe(struct vpe *v)
134134
{
135135
list_del(&v->list);
136136
if (v->load_addr)
137-
release_progmem(v);
137+
release_progmem(v->load_addr);
138138
kfree(v);
139139
}
140140

0 commit comments

Comments
 (0)