* [PATCH net-next-2.6] net_cls: Use __dev_get_by_index()
@ 2009-11-04 21:32 Eric Dumazet
2009-11-06 5:08 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2009-11-04 21:32 UTC (permalink / raw)
To: David S. Miller; +Cc: Linux Netdev List
We hold RTNL in tc_dump_tfilter(), we can avoid dev_hold()/dev_put()
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/sched/cls_api.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 7cf6c0f..c024da7 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 @@ errout:
if (cl)
cops->put(q, cl);
out:
- dev_put(dev);
return skb->len;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next-2.6] net_cls: Use __dev_get_by_index()
2009-11-04 21:32 [PATCH net-next-2.6] net_cls: Use __dev_get_by_index() Eric Dumazet
@ 2009-11-06 5:08 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-11-06 5:08 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 04 Nov 2009 22:32:59 +0100
> We hold RTNL in tc_dump_tfilter(), we can avoid dev_hold()/dev_put()
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied to net-next-2.6
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-06 5:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-04 21:32 [PATCH net-next-2.6] net_cls: Use __dev_get_by_index() Eric Dumazet
2009-11-06 5:08 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.