RDMA/nldev: Add checks for nla_nest_start() in fill_stat_counter_qps()
PATCH 1/1 RDMA/nldev: Add checks for nla_nest_start() in fill_stat_counter_qps()
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 <[email protected]>
--- drivers/infiniband/core/nldev.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/infiniband/core/nldev.c +2 -0
@@ -894,6 +894,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);
Signature · 1 line
2.17.1
Leon Romanovsky
AppliedQuoted 4 lines · Yuan Can
As the
nla_nest_start()may fail with NULL returned, the return value needs to be checked.
Applied, thanks!
[1/1] RDMA/nldev: Add checks for nla_nest_start() in fill_stat_counter_qps()
https://git.kernel.org/rdma/rdma/c/ea5ef136e215fd
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>