aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGao feng <gaofeng@cn.fujitsu.com>2012-10-04 16:15:49 -0400
committerDavid S. Miller <davem@davemloft.net>2012-10-07 00:30:56 -0400
commit809d5fc9bf6589276a12bd4fd611e4c7ff9940c3 (patch)
treec5a1b588f5ae1ceb21a898d354977c7df491e0e5
parent6dc878a8ca39e93f70c42f3dd7260bde10c1e0f1 (diff)
infiniband: pass rdma_cm module to netlink_dump_start
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>
-rw-r--r--drivers/infiniband/core/cma.c3
-rw-r--r--drivers/infiniband/core/netlink.c1
-rw-r--r--include/rdma/rdma_netlink.h1
3 files changed, 4 insertions, 1 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 26b37603dcf1..4fff27a7e37c 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -3498,7 +3498,8 @@ out:
3498} 3498}
3499 3499
3500static const struct ibnl_client_cbs cma_cb_table[] = { 3500static const struct ibnl_client_cbs cma_cb_table[] = {
3501 [RDMA_NL_RDMA_CM_ID_STATS] = { .dump = cma_get_id_stats }, 3501 [RDMA_NL_RDMA_CM_ID_STATS] = { .dump = cma_get_id_stats,
3502 .module = THIS_MODULE },
3502}; 3503};
3503 3504
3504static int __init cma_init(void) 3505static int __init cma_init(void)
diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c
index fe10a949aef9..da06abde9e0d 100644
--- a/drivers/infiniband/core/netlink.c
+++ b/drivers/infiniband/core/netlink.c
@@ -154,6 +154,7 @@ static int ibnl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
154 { 154 {
155 struct netlink_dump_control c = { 155 struct netlink_dump_control c = {
156 .dump = client->cb_table[op].dump, 156 .dump = client->cb_table[op].dump,
157 .module = client->cb_table[op].module,
157 }; 158 };
158 return netlink_dump_start(nls, skb, nlh, &c); 159 return netlink_dump_start(nls, skb, nlh, &c);
159 } 160 }
diff --git a/include/rdma/rdma_netlink.h b/include/rdma/rdma_netlink.h
index 3c5363ab867b..bd3d8b24b420 100644
--- a/include/rdma/rdma_netlink.h
+++ b/include/rdma/rdma_netlink.h
@@ -39,6 +39,7 @@ struct rdma_cm_id_stats {
39 39
40struct ibnl_client_cbs { 40struct ibnl_client_cbs {
41 int (*dump)(struct sk_buff *skb, struct netlink_callback *nlcb); 41 int (*dump)(struct sk_buff *skb, struct netlink_callback *nlcb);
42 struct module *module;
42}; 43};
43 44
44int ibnl_init(void); 45int ibnl_init(void);