RDMA/core: Fix error code in stat_get_doit_qp()
Subsystems (2)
PATCH 1/1 RDMA/core: Fix error code in stat_get_doit_qp()
We need to set the error codes on these paths. Currently the only possible error code is -EMSGSIZE so that's what the patch uses.
Fixes 83c2c1fcbd08 ("RDMA/nldev: Allow get counter mode through RDMA netlink")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/infiniband/core/nldev.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/infiniband/core/nldev.c +6 -2
@@ -1952,12 +1952,16 @@ static int stat_get_doit_qp(struct sk_buff *skb, struct nlmsghdr *nlh,if (fill_nldev_handle (msg, device) ||nla_put_u32 (msg,RDMA_NLDEV_ATTR_PORT_INDEX , port) || -nla_put_u32 (msg,RDMA_NLDEV_ATTR_STAT_MODE , mode)) +nla_put_u32 (msg,RDMA_NLDEV_ATTR_STAT_MODE , mode)) { + ret = -EMSGSIZE ; goto err_msg; + }if ((mode =RDMA_COUNTER_MODE_AUTO ) && -nla_put_u32 (msg,RDMA_NLDEV_ATTR_STAT_AUTO_MODE_MASK , mask)) +nla_put_u32 (msg,RDMA_NLDEV_ATTR_STAT_AUTO_MODE_MASK , mask)) { + ret = -EMSGSIZE ; goto err_msg; + }nlmsg_end (msg, nlh);ib_device_put (device);
Signature · 1 line
2.20.1
Quoted 9 lines · Dan Carpenter
We need to set the error codes on these paths. Currently the only possible error code is
-EMSGSIZEso that's what the patch uses.Fixes 83c2c1fcbd08 ("RDMA/nldev: Allow get counter mode through RDMA netlink")Signed-off-by Dan Carpenter <[email protected]>--- drivers/infiniband/core/nldev.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
Thanks,
Reviewed-by Leon Romanovsky <[email protected]>
Doug Ledford
AppliedQuoted 12 lines · Leon Romanovsky
Quoted 10 lines · Dan Carpenter
We need to set the error codes on these paths. Currently the only possible error code is
-EMSGSIZEso that's what the patch uses.Fixes 83c2c1fcbd08 ("RDMA/nldev: Allow get counter mode throughRDMA netlink")
Signed-off-by Dan Carpenter <[email protected]>--- drivers/infiniband/core/nldev.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
Quoted 2 lines
Thanks,
Reviewed-by Leon Romanovsky <[email protected]>
Thanks, applied to for-rc.
Signature · 3 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD