[PATCH] accel/qaic: Call DRM helper function to destroy prime GEM

Jeffrey Hugo quic_jhugo at quicinc.com
Tue Jun 20 14:17:31 UTC 2023


On 6/14/2023 10:15 AM, Jeffrey Hugo wrote:
> From: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy at quicinc.com>
> 
> smatch warning:
> 	drivers/accel/qaic/qaic_data.c:620 qaic_free_object() error:
> 		dereferencing freed memory 'obj->import_attach'
> 
> obj->import_attach is detached and freed using dma_buf_detach().
> But used after free to decrease the dmabuf ref count using
> dma_buf_put().
> 
> drm_prime_gem_destroy() handles this issue and performs the proper clean
> up instead of open coding it in the driver.
> 
> Fixes: ff13be830333 ("accel/qaic: Add datapath")
> Reported-by: Sukrut Bellary <sukrut.bellary at linux.com>
> Closes: https://lore.kernel.org/all/20230610021200.377452-1-sukrut.bellary@linux.com/
> Suggested-by: Christian König <christian.koenig at amd.com>
> Signed-off-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy at quicinc.com>
> Reviewed-by: Carl Vanderlip <quic_carlv at quicinc.com>
> Reviewed-by: Jeffrey Hugo <quic_jhugo at quicinc.com>
> Signed-off-by: Jeffrey Hugo <quic_jhugo at quicinc.com>

Pushed to drm-misc-fixes

-Jeff


More information about the dri-devel mailing list