vfio-pci/zdev: fix possible segmentation fault issue

In case allocation fails, we must behave correctly and exit with error.

Fixes: e6b817d4b8 ("vfio-pci/zdev: Add zPCI capabilities to VFIO_DEVICE_GET_INFO")
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
Max Gurtovoy 2021-02-01 16:28:25 +00:00 • committed by Alex Williamson
commit 7e31d6dc2c