]> 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>
Wed, 12 Sep 2012 07:08:13 +0000 (17:08 +1000)
commitf475ec4df3fcf0fde352ffe71297a1911779ef60
tree6c8899b0856c50326222da97ce7397f16a8cdadc
parent8ca506e8939ae1494c73e6b76f46949ed5e66917
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