* Re: [PATCH] more direct access of dev->refcnt
2003-05-07 20:23 [PATCH] more direct access of dev->refcnt Stephen Hemminger
@ 2003-05-07 19:30 ` David S. Miller
0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2003-05-07 19:30 UTC (permalink / raw)
To: shemminger; +Cc: philb, SteveW, netdev
From: Stephen Hemminger <shemminger@osdl.org>
Date: Wed, 7 May 2003 13:23:26 -0700
The following places directly increment dev refcount rather than
using the inline dev_hold.
Applied, thanks Stephen.
Also, Econet keeps pointers to devices without holding refcount
which is wrong.
Econet is pure orphan for years, looking for maintainer.
I occaisional consider trying to repair it.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] more direct access of dev->refcnt
@ 2003-05-07 20:23 Stephen Hemminger
2003-05-07 19:30 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2003-05-07 20:23 UTC (permalink / raw)
To: David S. Miller, philb, SteveW; +Cc: netdev
The following places directly increment dev refcount rather than
using the inline dev_hold.
Also, Econet keeps pointers to devices without holding refcount which
is wrong.
diff -Nru a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
--- a/net/decnet/dn_fib.c Wed May 7 13:22:27 2003
+++ b/net/decnet/dn_fib.c Wed May 7 13:22:27 2003
@@ -218,7 +218,7 @@
if (!(dev->flags&IFF_UP))
return -ENETDOWN;
nh->nh_dev = dev;
- atomic_inc(&dev->refcnt);
+ dev_hold(dev);
nh->nh_scope = RT_SCOPE_LINK;
return 0;
}
@@ -242,7 +242,7 @@
nh->nh_dev = DN_FIB_RES_DEV(res);
if (nh->nh_dev == NULL)
goto out;
- atomic_inc(&nh->nh_dev->refcnt);
+ dev_hold(nh->nh_dev);
err = -ENETDOWN;
if (!(nh->nh_dev->flags & IFF_UP))
goto out;
@@ -262,7 +262,7 @@
if (!(dev->flags&IFF_UP))
return -ENETDOWN;
nh->nh_dev = dev;
- atomic_inc(&nh->nh_dev->refcnt);
+ dev_hold(nh->nh_dev);
nh->nh_scope = RT_SCOPE_HOST;
}
diff -Nru a/net/econet/af_econet.c b/net/econet/af_econet.c
--- a/net/econet/af_econet.c Wed May 7 13:22:27 2003
+++ b/net/econet/af_econet.c Wed May 7 13:22:27 2003
@@ -325,7 +325,7 @@
{
/* Real hardware Econet. We're not worthy etc. */
#ifdef CONFIG_ECONET_NATIVE
- atomic_inc(&dev->refcnt);
+ dev_hold(dev);
skb = sock_alloc_send_skb(sk, len+dev->hard_header_len+15,
msg->msg_flags & MSG_DONTWAIT, &err);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-05-07 20:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-07 20:23 [PATCH] more direct access of dev->refcnt Stephen Hemminger
2003-05-07 19:30 ` 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).