mm: fix NULL ptr dereference in move_pages
mm: fix NULL ptr dereference in move_pages

Commit 3268c63 ("mm: fix move/migrate_pages() race on task struct") has
added an odd construct where 'mm' is checked for being NULL, and if it is,
it would get dereferenced anyways by mput()ing it.

Signed-off-by: Sasha Levin <611d453c03d02ce713e72b62ff6a901ea7e9cd77@gmail.com>
Cc: Dave Hansen <bfcdf3e6ca6cef45543bfbb57509c92aec9a39fb@linux.vnet.ibm.com>
Cc: Mel Gorman <2f629c4d93e35c3d371f0463b040c6ef04a5c1e5@csn.ul.ie>
Cc: Johannes Weiner <331be22c6b63ca3e0a03d408c2d906b1b02cd5f2@cmpxchg.org>
Cc: KOSAKI Motohiro <70a1d3ef3e17a2bb0f09a1b2e6c86f607ed1d6d9@jp.fujitsu.com>
Cc: KAMEZAWA Hiroyuki <634f508bd7c47cf0ee4126243675c3e598920fbc@jp.fujitsu.com>
Cc: Hugh Dickins <d3abdf3e2800e6cb849f11b81e6eb50b34d96431@google.com>
Acked-by: Christoph Lameter <ef3ecccf258fa062c5c6521a4887d40541963af7@linux.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas