Commit ed92369a authored by Jens Freimann's avatar Jens Freimann Committed by Alex Williamson
Browse files

vfio: don't ignore return value of migrate_add_blocker



When an error occurs in migrate_add_blocker() it sets a
negative return value and uses error pointer we pass in.
Instead of just looking at the error pointer check for a negative return
value and avoid a coverity error because the return value is
set but never used. This fixes CID 1407219.

Reported-by: Coverity (CID 1407219)
Fixes: f045a010 ("vfio: unplug failover primary device before migration")
Signed-off-by: default avatarJens Freimann <jfreimann@redhat.com>
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 1335d643
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2737,7 +2737,7 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
        error_setg(&vdev->migration_blocker,
                "VFIO device doesn't support migration");
        ret = migrate_add_blocker(vdev->migration_blocker, &err);
        if (err) {
        if (ret) {
            error_propagate(errp, err);
            error_free(vdev->migration_blocker);
            vdev->migration_blocker = NULL;