Skip to content

Commit 6b5f074

Browse files
Dan Carpenterrleon
authored andcommitted
RDMA/erdma: Fix error code in erdma_create_scatter_mtt()
The erdma_create_scatter_mtt() function is supposed to return error pointers. Returning NULL will lead to an Oops. Fixes: ed10435 ("RDMA/erdma: Implement hierarchical MTT") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Cheng Xu <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent c489800 commit 6b5f074

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/erdma/erdma_verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ static struct erdma_mtt *erdma_create_scatter_mtt(struct erdma_dev *dev,
655655

656656
mtt = kzalloc(sizeof(*mtt), GFP_KERNEL);
657657
if (!mtt)
658-
return NULL;
658+
return ERR_PTR(-ENOMEM);
659659

660660
mtt->size = ALIGN(size, PAGE_SIZE);
661661
mtt->buf = vzalloc(mtt->size);

0 commit comments

Comments
 (0)