]> 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>
Fri, 7 Sep 2012 00:17:42 +0000 (10:17 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 7 Sep 2012 05:36:00 +0000 (15:36 +1000)
commita1338b6d607eee3624eeaf28943ec8a4069f1af1
tree9d79e7948107f44b4f320d9cf6313b64599c03d0
parent4d0e8b737a38007373b449ec80385684171bc81a
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