Commit 809d5fc9bf6589276a12bd4fd611e4c7ff9940c3

Authored by Gao feng
Committed by David S. Miller
1 parent 6dc878a8ca

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>

Showing 3 changed files with 4 additions and 1 deletions Side-by-side Diff

drivers/infiniband/core/cma.c
... ... @@ -3498,7 +3498,8 @@
3498 3498 }
3499 3499  
3500 3500 static 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  
3504 3505 static int __init cma_init(void)
drivers/infiniband/core/netlink.c
... ... @@ -154,6 +154,7 @@
154 154 {
155 155 struct netlink_dump_control c = {
156 156 .dump = client->cb_table[op].dump,
  157 + .module = client->cb_table[op].module,
157 158 };
158 159 return netlink_dump_start(nls, skb, nlh, &c);
159 160 }
include/rdma/rdma_netlink.h
... ... @@ -39,6 +39,7 @@
39 39  
40 40 struct ibnl_client_cbs {
41 41 int (*dump)(struct sk_buff *skb, struct netlink_callback *nlcb);
  42 + struct module *module;
42 43 };
43 44  
44 45 int ibnl_init(void);