diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-03-27 15:59:30 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-03-27 15:59:30 -0700 |
| commit | faf44e54f6def4dd85b2ae35d6b332f81f9d7e91 (patch) | |
| tree | f8bcc55db8d01059436ef0a673540e02f2855abe /drivers | |
| parent | 56bea424158f6b99a452ab9410092d72b03f8545 (diff) | |
| parent | e98137f0a874ab36d0946de4707aa48cb7137d1c (diff) | |
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
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/vfio/pci/vfio_pci_dmabuf.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/vfio/pci/vfio_pci_dmabuf.c b/drivers/vfio/pci/vfio_pci_dmabuf.c index 478beafc6ac3..b1d658b8f7b5 100644 --- a/drivers/vfio/pci/vfio_pci_dmabuf.c +++ b/drivers/vfio/pci/vfio_pci_dmabuf.c @@ -301,11 +301,10 @@ int vfio_pci_core_feature_dma_buf(struct vfio_pci_core_device *vdev, u32 flags, */ ret = dma_buf_fd(priv->dmabuf, get_dma_buf.open_flags); if (ret < 0) - goto err_dma_buf; + dma_buf_put(priv->dmabuf); + return ret; -err_dma_buf: - dma_buf_put(priv->dmabuf); err_dev_put: vfio_device_put_registration(&vdev->vdev); err_free_phys: |
