sysctl: use xmalloc_array() for XEN_SYSCTL_page_offline_op
authorJan Beulich <jbeulich@suse.com>
Tue, 18 Feb 2020 16:52:10 +0000 (17:52 +0100)
committerJulien Grall <julien@xen.org>
Wed, 19 Feb 2020 12:35:36 +0000 (12:35 +0000)
commit7ad2164e922ebd7ee1543ba76f971cce22c27dc2
tree1f833938b985be6192620cfb0c2e5786345f0212
parent7b2b93d30cb973234eb6723c8c982e2f25ed9ed5
sysctl: use xmalloc_array() for XEN_SYSCTL_page_offline_op

This is more robust than the raw xmalloc_bytes().

Also add a sanity check on the input page range, to avoid returning
the less applicable -ENOMEM in such cases (and trying the allocation in
the first place).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen/common/sysctl.c