Skip to content

Commit faf44e5

Browse files
committed
Merge tag 'vfio-v7.0-rc6' of https://github.com/awilliam/linux-vfio
Pull VFIO fix from Alex Williamson: - Fix double-free and reference count underflow if dma-buf file allocation fails (Alex Williamson) * tag 'vfio-v7.0-rc6' of https://github.com/awilliam/linux-vfio: vfio/pci: Fix double free in dma-buf feature
2 parents 56bea42 + e98137f commit faf44e5

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/vfio/pci/vfio_pci_dmabuf.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,10 @@ int vfio_pci_core_feature_dma_buf(struct vfio_pci_core_device *vdev, u32 flags,
301301
*/
302302
ret = dma_buf_fd(priv->dmabuf, get_dma_buf.open_flags);
303303
if (ret < 0)
304-
goto err_dma_buf;
304+
dma_buf_put(priv->dmabuf);
305+
305306
return ret;
306307

307-
err_dma_buf:
308-
dma_buf_put(priv->dmabuf);
309308
err_dev_put:
310309
vfio_device_put_registration(&vdev->vdev);
311310
err_free_phys:

0 commit comments

Comments
 (0)