mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
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: ac80cd17a6
("dma-buf: Clarify that dma-buf sg lists are page aligned")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/398485/
This commit is contained in:
parent
2b5b95b1ff
commit
00efd65a65
@ -908,7 +908,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DMA_API_DEBUG
|
||||
{
|
||||
if (!IS_ERR(sg_table)) {
|
||||
struct scatterlist *sg;
|
||||
u64 addr;
|
||||
int len;
|
||||
|
Loading…
Reference in New Issue
Block a user