fill_vswap_ub(): fix a potential segfault

Currently this can't happen, since the presence of swappages
is checked in either check_ub() (for vzctl start) or
in set_check_mode() (for vzctl set). Nevertheless, if in the future
someone would call fill_vswap_ub() from some random place, it should
not segfault.

So, check if swap is set and refuse to proceed otherwise.

Note that the physpages is checked in is_vswap_config() so there's no
need to do the same for it.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed