Skip to content

Commit ca4b3f3

Browse files
Jianguo Wutorvalds
Jianguo Wu
authored andcommitted
mm/hotplug: only free wait_table if it's allocated by vmalloc
zone->wait_table may be allocated from bootmem, it can not be freed. Signed-off-by: Jianguo Wu <[email protected]> Reviewed-by: Tang Chen <[email protected]> Cc: Tang Chen <[email protected]> Cc: Jiang Liu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 96e7d7a commit ca4b3f3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mm/memory_hotplug.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1779,7 +1779,11 @@ void try_offline_node(int nid)
17791779
for (i = 0; i < MAX_NR_ZONES; i++) {
17801780
struct zone *zone = pgdat->node_zones + i;
17811781

1782-
if (zone->wait_table)
1782+
/*
1783+
* wait_table may be allocated from boot memory,
1784+
* here only free if it's allocated by vmalloc.
1785+
*/
1786+
if (is_vmalloc_addr(zone->wait_table))
17831787
vfree(zone->wait_table);
17841788
}
17851789

0 commit comments

Comments
 (0)