diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 7cf6c0fbc7a6d930cf2affe67ab7dd930ec490f8..c024da77824f512b6d07034ff4091a0a6ab912da 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -404,6 +404,7 @@ static int tcf_node_dump(struct tcf_proto *tp, unsigned long n, a->cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWTFILTER); } +/* called with RTNL */ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) { struct net *net = sock_net(skb->sk); @@ -422,7 +423,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) if (cb->nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*tcm))) return skb->len; - if ((dev = dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL) + if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL) return skb->len; if (!tcm->tcm_parent) @@ -484,7 +485,6 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) if (cl) cops->put(q, cl); out: - dev_put(dev); return skb->len; }