]> git.ipfire.org Git - thirdparty/qemu.git/commit
pcie_sriov: Remove g_new assertion
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Thu, 23 Nov 2023 07:56:29 +0000 (16:56 +0900)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 13 Dec 2023 15:50:45 +0000 (18:50 +0300)
commited7e167699912cb60c2127a2d4417f8cb2fa79ca
treed9c8430fce4d2ed6d74c7feb839f668e02177a67
parent59de6e246fc7504ae78460df81e97d17f8fef2c6
pcie_sriov: Remove g_new assertion

g_new() aborts if the allocation fails so it returns NULL only if the
requested allocation size is zero. register_vfs() makes such an
allocation if NumVFs is zero so it should not assert that g_new()
returns a non-NULL value.

Fixes: 7c0fa8dff8 ("pcie: Add support for Single Root I/O Virtualization (SR/IOV)")
Buglink: https://issues.redhat.com/browse/RHEL-17209
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20231123075630.12057-1-akihiko.odaki@daynix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Yanghang Liu<yanghliu@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 714a1415d7a69174e1640fcdd6eaae180fe438aa)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/pci/pcie_sriov.c