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);
|