mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-07 12:17:18 +00:00
mdev: Fix mingw build by adding a check for non-NULL pointer
This patch fixes the following MinGW error (although actually being a false positive): ../../src/util/virmdev.c: In function 'virMediatedDeviceListMarkDevices': ../../src/util/virmdev.c:453:21: error: potential null pointer dereference [-Werror=null-dereference] const char *mdev_path = mdev->path; ^~~~~~~~~ Signed-off-by: Erik Skultety <eskultet@redhat.com> (cherry picked from commit 574718d366170b22227eda640ad94f414e9c7e2f)
This commit is contained in:
parent
5c87aaa3a7
commit
91a9a4e3ae
@ -449,9 +449,13 @@ virMediatedDeviceListMarkDevices(virMediatedDeviceListPtr dst,
|
||||
|
||||
virObjectLock(dst);
|
||||
for (i = 0; i < count; i++) {
|
||||
const char *mdev_path = NULL;
|
||||
virMediatedDevicePtr mdev = virMediatedDeviceListGet(src, i);
|
||||
const char *mdev_path = mdev->path;
|
||||
|
||||
if (!mdev)
|
||||
goto cleanup;
|
||||
|
||||
mdev_path = mdev->path;
|
||||
if (virMediatedDeviceIsUsed(mdev, dst) ||
|
||||
virMediatedDeviceSetUsedBy(mdev, drvname, domname) < 0)
|
||||
goto cleanup;
|
||||
|
Loading…
x
Reference in New Issue
Block a user