Skip to content
Commit 18b48d58 authored by Wen Congyang's avatar Wen Congyang Committed by Linus Torvalds
Browse files

memory hotplug: reset pgdat->kswapd to NULL if creating kernel thread fails



If kthread_run() fails, pgdat->kswapd contains errno.  When we stop this
thread, we only check whether pgdat->kswapd is NULL and access it.  If
it contains errno, it will cause page fault.  Reset pgdat->kswapd to
NULL when creating kernel thread fails can avoid this problem.

Signed-off-by: default avatarWen Congyang <wency@cn.fujitsu.com>
Reviewed-by: default avatarMinchan Kim <minchan@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6bf61045
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment