projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1895e90
)
RDMA/nldev: Add checks for nla_nest_start() in fill_stat_counter_qps()
author
Yuan Can
<yuancan@huawei.com>
Sat, 26 Nov 2022 04:34:10 +0000
(
04:34
+0000)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:25 +0000
(13:14 +0100)
[ Upstream commit
ea5ef136e215fdef35f14010bc51fcd6686e6922
]
As the nla_nest_start() may fail with NULL returned, the return value needs
to be checked.
Fixes: c4ffee7c9bdb ("RDMA/netlink: Implement counter dumpit calback")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Link:
https://lore.kernel.org/r/20221126043410.85632-1-yuancan@huawei.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/core/nldev.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/core/nldev.c
b/drivers/infiniband/core/nldev.c
index 6f3799698634c9afee20acf988de68b449a48e98..cefe12964f3eb7970fd53808452bb1fac0f71699 100644
(file)
--- a/
drivers/infiniband/core/nldev.c
+++ b/
drivers/infiniband/core/nldev.c
@@
-892,6
+892,8
@@
static int fill_stat_counter_qps(struct sk_buff *msg,
int ret = 0;
table_attr = nla_nest_start(msg, RDMA_NLDEV_ATTR_RES_QP);
+ if (!table_attr)
+ return -EMSGSIZE;
rt = &counter->device->res[RDMA_RESTRACK_QP];
xa_lock(&rt->xa);