mem: Fix short of nodemask array.

In kernel, if user specified more nodes, e.g, 512 nodes, than the
supported, e.g, 4 nodes, kernel will check if the non supported
part, e.g, 508 nodes, is all zeroed in node bitmap. Currently, we
are overrunning "nmask", whose length is shorter than MAXNODES,
and where the unsupported bits should be cleared to pass the check.

Signed-off-by: Lans Zhang <lans.zhang2008@gmail.com>
Reviewed-by: Jan Stancek <jstancek@redhat.com>
Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Reviewed-by: Zhouping Liu <zliu@redhat.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
5 files changed