projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c489800
)
RDMA/erdma: Fix error code in erdma_create_scatter_mtt()
author
Dan Carpenter
<dan.carpenter@linaro.org>
Wed, 6 Sep 2023 11:23:52 +0000
(14:23 +0300)
committer
Leon Romanovsky
<leon@kernel.org>
Mon, 18 Sep 2023 06:12:00 +0000
(09:12 +0300)
The erdma_create_scatter_mtt() function is supposed to return error
pointers. Returning NULL will lead to an Oops.
Fixes:
ed10435d3583
("RDMA/erdma: Implement hierarchical MTT")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link:
https://lore.kernel.org/r/1eb400d5-d8a3-4a8e-b3da-c43c6c377f86@moroto.mountain
Acked-by: Cheng Xu <chengyou@linux.alibaba.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/erdma/erdma_verbs.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/hw/erdma/erdma_verbs.c
b/drivers/infiniband/hw/erdma/erdma_verbs.c
index
dcccb60
..
70eaed5
100644
(file)
--- a/
drivers/infiniband/hw/erdma/erdma_verbs.c
+++ b/
drivers/infiniband/hw/erdma/erdma_verbs.c
@@
-655,7
+655,7
@@
static struct erdma_mtt *erdma_create_scatter_mtt(struct erdma_dev *dev,
mtt = kzalloc(sizeof(*mtt), GFP_KERNEL);
if (!mtt)
- return
NULL
;
+ return
ERR_PTR(-ENOMEM)
;
mtt->size = ALIGN(size, PAGE_SIZE);
mtt->buf = vzalloc(mtt->size);