]> git.ipfire.org Git - thirdparty/qemu.git/commit
vfio/iommufd: Fix SIGSEV in iommufd_cdev_attach()
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Thu, 16 Jan 2025 10:23:07 +0000 (18:23 +0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 12 Feb 2025 19:12:02 +0000 (22:12 +0300)
commitd47f418ea15cd405f41984af80c3cd336c693be3
treeb88f9fcb5c7c940d8eb04c4cb7c9e37c501bdc29
parentfe21d932f281d4e80fd56bb0749ef9cd95b03c8e
vfio/iommufd: Fix SIGSEV in iommufd_cdev_attach()

When iommufd_cdev_ram_block_discard_disable() fails for whatever reason,
errp should be set or else SIGSEV is triggered in vfio_realize() when
error_prepend() is called.

By this chance, use the same error message for both legacy and iommufd
backend.

Fixes: 5ee3dc7af785 ("vfio/iommufd: Implement the iommufd backend")
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/20250116102307.260849-1-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
(cherry picked from commit 7b3d5b84cbd742356a1afc6b0fa489d0663f235d)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/vfio/iommufd.c