Message ID | 20211223033948.5208-1-xiongx18@fudan.edu.cn |
---|---|
State | New |
Headers | show |
Series | drm/i915/selftests: fix potential refcnt issue of a dma_buf object | expand |
diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c index 4a6bb64c3..b24bc506f 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c @@ -428,12 +428,14 @@ static int igt_dmabuf_export_vmap(void *arg) if (memchr_inv(ptr, 0, dmabuf->size)) { pr_err("Exported object not initialiased to zero!\n"); err = -EINVAL; - goto out; + goto out_dma_map; } memset(ptr, 0xc5, dmabuf->size); err = 0; + +out_dma_map: dma_buf_vunmap(dmabuf, &map); out: dma_buf_put(dmabuf);