]> git.baikalelectronics.ru Git - kernel.git/commit
vfio/mbochs: Fix missing error unwind of mbochs_used_mbytes
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 6 Aug 2021 01:18:58 +0000 (22:18 -0300)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 11 Aug 2021 15:50:10 +0000 (09:50 -0600)
commitc7130ecdd7cdd92ad55cd93fcd74a3d29c9b1964
treed7af67843eedbccdcae8425e877d8a32024ec9ed
parent47f460e69147d4343689348f06705417b8bf619a
vfio/mbochs: Fix missing error unwind of mbochs_used_mbytes

Convert mbochs to use an atomic scheme for this like mtty was changed
into. The atomic fixes various race conditions with probing. Add the
missing error unwind. Also add the missing kfree of mdev_state->pages.

Fixes: 05de5391b5be ("vfio/mbochs: Convert to use vfio_register_group_dev()")
Reported-by: Cornelia Huck <cohuck@redhat.com>
Co-developed-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Link: https://lore.kernel.org/r/2-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
samples/vfio-mdev/mbochs.c