Skip to content

Commit 00efd65

Browse files
j-xiongChristianKoenigAMD
authored andcommitted
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: ac80cd1 ("dma-buf: Clarify that dma-buf sg lists are page aligned") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Jianxin Xiong <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/398485/
1 parent 2b5b95b commit 00efd65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma-buf/dma-buf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,
908908
}
909909

910910
#ifdef CONFIG_DMA_API_DEBUG
911-
{
911+
if (!IS_ERR(sg_table)) {
912912
struct scatterlist *sg;
913913
u64 addr;
914914
int len;

0 commit comments

Comments
 (0)