]> git.karo-electronics.de Git - karo-tx-linux.git/commit
memory hotplug: reset pgdat->kswapd to NULL if creating kernel thread fails
authorWen Congyang <wency@cn.fujitsu.com>
Thu, 13 Sep 2012 00:58:09 +0000 (10:58 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 17 Sep 2012 10:22:17 +0000 (20:22 +1000)
commit4cca1a18f34b7c8b40bdca76ba8d6a57cdbe90f6
tree71a0ff8b663437ee2b3f1c9b290898ac35be43f2
parent8f90a25ab1b5639273b3b4a1518368c40d51fd57
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: Wen Congyang <wency@cn.fujitsu.com>
Reviewed-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmscan.c