提交 00efd65a 编写于 作者: J Jianxin Xiong 提交者: Christian König

dma-buf: Fix static checker warning

Here is the warning message:

	drivers/dma-buf/dma-buf.c:917 dma_buf_map_attachment()
	error: 'sg_table' dereferencing possible ERR_PTR()

Fix by adding error checking before dereferencing the pointer.

Fixes: ac80cd17 ("dma-buf: Clarify that dma-buf sg lists are page aligned")
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NJianxin Xiong <jianxin.xiong@intel.com>
Reviewed-by: NChristian König <christian.koenig@amd.com>
Signed-off-by: NChristian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/398485/
上级 2b5b95b1
...@@ -908,7 +908,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach, ...@@ -908,7 +908,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,
} }
#ifdef CONFIG_DMA_API_DEBUG #ifdef CONFIG_DMA_API_DEBUG
{ if (!IS_ERR(sg_table)) {
struct scatterlist *sg; struct scatterlist *sg;
u64 addr; u64 addr;
int len; int len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册