]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
vfio/virtio: Use guard() for migf->lock where applicable
authorAlex Williamson <alex.williamson@nvidia.com>
Tue, 14 Apr 2026 20:06:21 +0000 (14:06 -0600)
committerAlex Williamson <alex@shazbot.org>
Tue, 21 Apr 2026 18:01:21 +0000 (12:01 -0600)
commitb5b268cb7868b598e53eeebd36174c8b27d4cd86
treebe2d0f50dd4a8cdf14dcebf78121512ea6c06612
parent61fcb51fc9d576ec367e8aea9c03dc6a746e395e
vfio/virtio: Use guard() for migf->lock where applicable

Convert migf->lock acquisitions in virtiovf_disable_fd() and
virtiovf_save_read() to use guard().  In virtiovf_save_read() this
eliminates the out_unlock label and multiple goto paths by allowing
direct returns, and removes the need for the done variable to double
as an error carrier.

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Alex Williamson <alex.williamson@nvidia.com>
Reviewed-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://lore.kernel.org/r/20260414200625.3601509-4-alex.williamson@nvidia.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
drivers/vfio/pci/virtio/migrate.c