Re: Fwd: [PATCH 4/4] vfio/pci: Allow MMIO regions to be exported through dma-buf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 21, 2022 at 04:51:34PM +0300, Oded Gabbay wrote:

> > +static void vfio_pci_dma_buf_unmap(struct dma_buf_attachment *attachment,
> > +                                  struct sg_table *sgt,
> > +                                  enum dma_data_direction dir)
> > +{
> > +       struct vfio_pci_dma_buf *priv = attachment->dmabuf->priv;
> > +
> > +       dma_unmap_resource(attachment->dev, sg_dma_address(sgt->sgl),
> > +                          priv->dmabuf->size, dir, DMA_ATTR_SKIP_CPU_SYNC);
> > +       sg_free_table(sgt);
> Before calling sg_free_table(), you need to restore the orig_nents as
> it is used in that function to free the allocated memory of the sgt.

Oops, right, thanks good catch

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux