]> git.ipfire.org Git - thirdparty/qemu.git/commit
vdpa: Fix file descriptor leak on get features error
authorEugenio Pérez <eperezma@redhat.com>
Tue, 2 Aug 2022 11:24:46 +0000 (13:24 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 4 Aug 2022 11:46:08 +0000 (13:46 +0200)
commitaed5da45daf734ddc543c0791e877dac75e16f61
tree745a1f8a35e24e8e365a262edbdbb1099f14df21
parent9567fc1665b6649d2aff0184f68377a9e7c30dd9
vdpa: Fix file descriptor leak on get features error

File descriptor vdpa_device_fd is not free in the case of returning
error from vhost_vdpa_get_features. Fixing it by making all errors go to
the same error path.

Resolves: Coverity CID 1490785
Fixes: 8170ab3f43 ("vdpa: Extract get features part from vhost_vdpa_get_max_queue_pairs")
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20220802112447.249436-2-eperezma@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
net/vhost-vdpa.c