| To: | "David S. Miller" <davem@xxxxxxxxxx> |
|---|---|
| Subject: | [PATCH 2.6]: Fix device leaks in mirred action |
| From: | Patrick McHardy <kaber@xxxxxxxxx> |
| Date: | Thu, 04 Nov 2004 07:30:02 +0100 |
| Cc: | netdev@xxxxxxxxxxx, jamal <hadi@xxxxxxxxxx> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 |
When a mirred action is created it takes two references to the device (dev_get_by_index + dev_hold), but only drops one when it gets destroyed. It also leaks a reference when a mirred action is replaced. # This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/11/04 07:28:30+01:00 kaber@xxxxxxxxxxxx
# [PKT_SCHED]: Fix device leaks in mirred action
#
# Signed-off-by: Patrick McHardy <kaber@xxxxxxxxx>
#
# net/sched/mirred.c
# 2004/11/04 07:28:24+01:00 kaber@xxxxxxxxxxxx +2 -1
# [PKT_SCHED]: Fix device leaks in mirred action
#
# Signed-off-by: Patrick McHardy <kaber@xxxxxxxxx>
#
diff -Nru a/net/sched/mirred.c b/net/sched/mirred.c
--- a/net/sched/mirred.c 2004-11-04 07:28:59 +01:00
+++ b/net/sched/mirred.c 2004-11-04 07:28:59 +01:00
@@ -138,8 +138,9 @@
p->eaction = parm->eaction;
if (parm->ifindex) {
p->ifindex = parm->ifindex;
+ if (ovr)
+ dev_put(p->dev);
p->dev = dev;
- dev_hold(p->dev);
}
spin_unlock(&p->lock);
}
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 2.6 5/5]: act_api: mark some functions static/remove unused function, Patrick McHardy |
|---|---|
| Next by Date: | kernel scalability, Anil Gunturu |
| Previous by Thread: | [PATCH 2.6 5/5]: act_api: mark some functions static/remove unused function, Patrick McHardy |
| Next by Thread: | Re: [PATCH 2.6]: Fix device leaks in mirred action, jamal |
| Indexes: | [Date] [Thread] [Top] [All Lists] |