]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
RDMA/cma: Use correct size when writing netlink stats
authorParav Pandit <parav@mellanox.com>
Tue, 14 Nov 2017 12:51:55 +0000 (14:51 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 18 Dec 2017 22:37:05 +0000 (15:37 -0700)
The code was using the src size when formatting the dst. They are almost
certainly the same value but it reads wrong.

Fixes: ce117ffac2e9 ("RDMA/cma: Export AF_IB statistics")
Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/cma.c

index 1fdb473b5df7be38c09ecd49121d516b4893ef13..9841e7ca5c06677a0086838a66a6cd4ade776c65 100644 (file)
@@ -4431,7 +4431,7 @@ static int cma_get_id_stats(struct sk_buff *skb, struct netlink_callback *cb)
                                          RDMA_NL_RDMA_CM_ATTR_SRC_ADDR))
                                goto out;
                        if (ibnl_put_attr(skb, nlh,
-                                         rdma_addr_size(cma_src_addr(id_priv)),
+                                         rdma_addr_size(cma_dst_addr(id_priv)),
                                          cma_dst_addr(id_priv),
                                          RDMA_NL_RDMA_CM_ATTR_DST_ADDR))
                                goto out;