infiniband: pass rdma_cm module to netlink_dump_start

[ Upstream commit 809d5fc9bf ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Gao feng 2012-10-04 20:15:49 +00:00 committed by Greg Kroah-Hartman
parent 70f7f1c70a
commit 6114941a29
3 changed files with 4 additions and 1 deletions

View file

@ -3451,7 +3451,8 @@ out:
} }
static const struct ibnl_client_cbs cma_cb_table[] = { 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) static int __init cma_init(void)

View file

@ -151,6 +151,7 @@ static int ibnl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
{ {
struct netlink_dump_control c = { struct netlink_dump_control c = {
.dump = client->cb_table[op].dump, .dump = client->cb_table[op].dump,
.module = client->cb_table[op].module,
}; };
return netlink_dump_start(nls, skb, nlh, &c); return netlink_dump_start(nls, skb, nlh, &c);
} }

View file

@ -39,6 +39,7 @@ struct rdma_cm_id_stats {
struct ibnl_client_cbs { struct ibnl_client_cbs {
int (*dump)(struct sk_buff *skb, struct netlink_callback *nlcb); int (*dump)(struct sk_buff *skb, struct netlink_callback *nlcb);
struct module *module;
}; };
int ibnl_init(void); int ibnl_init(void);