* [PATCH] [NET] NEIGHBOUR: hold refcnt of net_device from proxy neighbor entries.
@ 2004-09-30 8:07 YOSHIFUJI Hideaki / 吉藤英明
2004-10-01 22:17 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2004-09-30 8:07 UTC (permalink / raw)
To: davem; +Cc: netdev
Hello.
[NET] NEIGHBOUR: hold refcnt of net_device from proxy neighbor entries.
We did not hold refcnt of net_device from proxy neighbor entries
while we did from neighbor entries.
Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Thanks.
diff -Nru a/net/core/neighbour.c b/net/core/neighbour.c
--- a/net/core/neighbour.c 2004-09-30 16:32:24 +09:00
+++ b/net/core/neighbour.c 2004-09-30 16:32:24 +09:00
@@ -496,8 +496,12 @@
memcpy(n->key, pkey, key_len);
n->dev = dev;
+ if (dev)
+ dev_hold(dev);
if (tbl->pconstructor && tbl->pconstructor(n)) {
+ if (dev)
+ dev_put(dev);
kfree(n);
n = NULL;
goto out;
@@ -532,6 +536,8 @@
write_unlock_bh(&tbl->lock);
if (tbl->pdestructor)
tbl->pdestructor(n);
+ if (n->dev)
+ dev_put(n->dev);
kfree(n);
return 0;
}
@@ -552,6 +558,8 @@
*np = n->next;
if (tbl->pdestructor)
tbl->pdestructor(n);
+ if (n->dev)
+ dev_put(n->dev);
kfree(n);
continue;
}
--
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] [NET] NEIGHBOUR: hold refcnt of net_device from proxy neighbor entries.
2004-09-30 8:07 [PATCH] [NET] NEIGHBOUR: hold refcnt of net_device from proxy neighbor entries YOSHIFUJI Hideaki / 吉藤英明
@ 2004-10-01 22:17 ` David S. Miller
0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-10-01 22:17 UTC (permalink / raw)
To: yoshfuji; +Cc: netdev
On Thu, 30 Sep 2004 17:07:29 +0900 (JST)
YOSHIFUJI Hideaki / ^[$B5HF#1QL@^[(B <yoshfuji@linux-ipv6.org> wrote:
> [NET] NEIGHBOUR: hold refcnt of net_device from proxy neighbor entries.
>
> We did not hold refcnt of net_device from proxy neighbor entries
> while we did from neighbor entries.
>
> Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-10-01 22:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-30 8:07 [PATCH] [NET] NEIGHBOUR: hold refcnt of net_device from proxy neighbor entries YOSHIFUJI Hideaki / 吉藤英明
2004-10-01 22:17 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).