net/virtio-user: check value returned from malloc
net/virtio-user: check value returned from malloc

Value returned from malloc is not checked for errors before being used.
This patch fixes following coverity issue.

    static struct vhost_memory_kernel *
    prepare_vhost_memory_kernel(void)
    {
        ...
        vm = malloc(sizeof(struct vhost_memory_kernel) +
                    max_regions *
                    sizeof(struct vhost_memory_region));
        ...
    >>>     CID 140744:    (NULL_RETURNS)
    >>>     Dereferencing a null pointer "vm".
                mr = &vm->regions[k++];

Coverity issue: 140744
Fixes: e3b434818bbb ("net/virtio-user: support kernel vhost")

Signed-off-by: Jianfeng Tan <4339d9ba3a87a0d192e405945005ff86667f7b0c@intel.com>
Acked-by: Yuanhan Liu <5dcef21195e64c9c08aa779bb62b25e9133eaa33@linux.intel.com>

john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk