> +struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? struct device *dev)
> +{
> + ? ? ? struct dma_buf_attachment *attach;
> + ? ? ? int ret;
> +
> + ? ? ? BUG_ON(!dmabuf || !dev);
> +
> + ? ? ? mutex_lock(&dmabuf->lock);
> +
> + ? ? ? attach = kzalloc(sizeof(struct dma_buf_attachment), GFP_KERNEL);
> + ? ? ? if (attach == NULL)
> + ? ? ? ? ? ? ? goto err_alloc;
> +
> + ? ? ? attach->dev = dev;
> + ? ? ? if (dmabuf->ops->attach) {
> + ? ? ? ? ? ? ? ret = dmabuf->ops->attach(dmabuf, dev, attach);
> + ? ? ? ? ? ? ? if (!ret)
> + ? ? ? ? ? ? ? ? ? ? ? goto err_attach;
> + ? ? ? }
> + ? ? ? list_add(&attach->node, &dmabuf->attachments);
> +

I would assume at some point this needed at
attach->dmabuf = dmabuf;
added.

Dave.

Reply via email to