infiniband: pass rdma_cm module to netlink_dump_start
authorGao feng <gaofeng@cn.fujitsu.com>
Thu, 4 Oct 2012 20:15:49 +0000 (20:15 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 7 Oct 2012 04:30:56 +0000 (00:30 -0400)
set netlink_dump_control.module to avoid panic.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Cc: Roland Dreier <roland@kernel.org>
Cc: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/infiniband/core/cma.c
drivers/infiniband/core/netlink.c
include/rdma/rdma_netlink.h

index 26b37603dcf11b63a7ae396d93533fed8a2a09cd..4fff27a7e37c0773eb79e838915e7d2646f7583c 100644 (file)
@@ -3498,7 +3498,8 @@ out:
 }
 
 static const struct ibnl_client_cbs cma_cb_table[] = {
-       [RDMA_NL_RDMA_CM_ID_STATS] = { .dump = cma_get_id_stats },
+       [RDMA_NL_RDMA_CM_ID_STATS] = { .dump = cma_get_id_stats,
+                                      .module = THIS_MODULE },
 };
 
 static int __init cma_init(void)
index fe10a949aef9b6bd0533da3c4886933ee4a2091f..da06abde9e0d557ae1536f1995cd1a84af6ab219 100644 (file)
@@ -154,6 +154,7 @@ static int ibnl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
                        {
                                struct netlink_dump_control c = {
                                        .dump = client->cb_table[op].dump,
+                                       .module = client->cb_table[op].module,
                                };
                                return netlink_dump_start(nls, skb, nlh, &c);
                        }
index 3c5363ab867b263e24d1c94da2714be532236795..bd3d8b24b42024f848ffd0c55f2dc58dc6de1b28 100644 (file)
@@ -39,6 +39,7 @@ struct rdma_cm_id_stats {
 
 struct ibnl_client_cbs {
        int (*dump)(struct sk_buff *skb, struct netlink_callback *nlcb);
+       struct module *module;
 };
 
 int ibnl_init(void);