Part of the function uses the properly-typed dmabuf variable, the
other an untyped void *buf. Kill the later.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
int *prime_fd)
{
struct drm_gem_object *obj;
int *prime_fd)
{
struct drm_gem_object *obj;
int ret = 0;
struct dma_buf *dmabuf;
int ret = 0;
struct dma_buf *dmabuf;
- buf = dev->driver->gem_prime_export(dev, obj, flags);
- if (IS_ERR(buf)) {
+ dmabuf = dev->driver->gem_prime_export(dev, obj, flags);
+ if (IS_ERR(dmabuf)) {
/* normally the created dma-buf takes ownership of the ref,
* but if that fails then drop the ref
*/
/* normally the created dma-buf takes ownership of the ref,
* but if that fails then drop the ref
*/
- obj->export_dma_buf = buf;
+ obj->export_dma_buf = dmabuf;
/* if we've exported this buffer the cheat and add it to the import list
* so we get the correct handle back
/* if we've exported this buffer the cheat and add it to the import list
* so we get the correct handle back
if (ret)
goto fail_put_dmabuf;
if (ret)
goto fail_put_dmabuf;
- ret = dma_buf_fd(buf, flags);
+ ret = dma_buf_fd(dmabuf, flags);
if (ret < 0)
goto fail_rm_handle;
if (ret < 0)
goto fail_rm_handle;
goto out;
fail_rm_handle:
goto out;
fail_rm_handle:
- drm_prime_remove_buf_handle_locked(&file_priv->prime, buf);
+ drm_prime_remove_buf_handle_locked(&file_priv->prime,
+ dmabuf);
fail_put_dmabuf:
/* clear NOT to be checked when releasing dma_buf */
obj->export_dma_buf = NULL;
fail_put_dmabuf:
/* clear NOT to be checked when releasing dma_buf */
obj->export_dma_buf = NULL;
out:
drm_gem_object_unreference_unlocked(obj);
mutex_unlock(&file_priv->prime.lock);
out:
drm_gem_object_unreference_unlocked(obj);
mutex_unlock(&file_priv->prime.lock);