瀏覽代碼

lguest: fix switcher_page leak on unload

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

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Johannes Weiner 17 年之前
父節點
當前提交
0a707210aa
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/lguest/core.c

+ 1 - 0
drivers/lguest/core.c

@@ -135,6 +135,7 @@ static void unmap_switcher(void)
 	/* Now we just need to free the pages we copied the switcher into */
 	/* Now we just need to free the pages we copied the switcher into */
 	for (i = 0; i < TOTAL_SWITCHER_PAGES; i++)
 	for (i = 0; i < TOTAL_SWITCHER_PAGES; i++)
 		__free_pages(switcher_page[i], 0);
 		__free_pages(switcher_page[i], 0);
+	kfree(switcher_page);
 }
 }
 
 
 /*H:032
 /*H:032