Skip to contentSkip to conversation

lguest: fix switcher_page leak on unload

PATCH Applied Johannes Weiner 2 participants 2 messages Jul 8, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lguest: fix switcher_page leak on unload

map_switcher allocates the array, unmap_switcher has to free it accordingly.

---

drivers/lguest/core.c +1 -0
index 5eea435..90663e0 100644
@@ -135,6 +135,7 @@ static void unmap_switcher(void)
 	/* Now we just need to free the pages we copied the switcher into */
 	for (i = 0; i < TOTAL_SWITCHER_PAGES; i++)
 		__free_pages(switcher_page[i], 0);
+	kfree(switcher_page);
 }
 
 /*H:032
#1 lore raw
Quoted 2 lines · On Tuesday 08 July 2008 18:29:42 Johannes Weiner wrote:

map_switcher allocates the array, unmap_switcher has to free it accordingly.

Applied, thanks Johannes! A small mem leak on module remove probably isn't worth sending for -rc9, but queued for next merge.

Cheers,
Rusty.