Commit b0ebbe1d authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[NET]: Kill more direct references to netdev->refcnt.

parent 49e97b6d
...@@ -218,7 +218,7 @@ static int dn_fib_check_nh(const struct rtmsg *r, struct dn_fib_info *fi, struct ...@@ -218,7 +218,7 @@ static int dn_fib_check_nh(const struct rtmsg *r, struct dn_fib_info *fi, struct
if (!(dev->flags&IFF_UP)) if (!(dev->flags&IFF_UP))
return -ENETDOWN; return -ENETDOWN;
nh->nh_dev = dev; nh->nh_dev = dev;
atomic_inc(&dev->refcnt); dev_hold(dev);
nh->nh_scope = RT_SCOPE_LINK; nh->nh_scope = RT_SCOPE_LINK;
return 0; return 0;
} }
...@@ -242,7 +242,7 @@ static int dn_fib_check_nh(const struct rtmsg *r, struct dn_fib_info *fi, struct ...@@ -242,7 +242,7 @@ static int dn_fib_check_nh(const struct rtmsg *r, struct dn_fib_info *fi, struct
nh->nh_dev = DN_FIB_RES_DEV(res); nh->nh_dev = DN_FIB_RES_DEV(res);
if (nh->nh_dev == NULL) if (nh->nh_dev == NULL)
goto out; goto out;
atomic_inc(&nh->nh_dev->refcnt); dev_hold(nh->nh_dev);
err = -ENETDOWN; err = -ENETDOWN;
if (!(nh->nh_dev->flags & IFF_UP)) if (!(nh->nh_dev->flags & IFF_UP))
goto out; goto out;
...@@ -262,7 +262,7 @@ static int dn_fib_check_nh(const struct rtmsg *r, struct dn_fib_info *fi, struct ...@@ -262,7 +262,7 @@ static int dn_fib_check_nh(const struct rtmsg *r, struct dn_fib_info *fi, struct
if (!(dev->flags&IFF_UP)) if (!(dev->flags&IFF_UP))
return -ENETDOWN; return -ENETDOWN;
nh->nh_dev = dev; nh->nh_dev = dev;
atomic_inc(&nh->nh_dev->refcnt); dev_hold(nh->nh_dev);
nh->nh_scope = RT_SCOPE_HOST; nh->nh_scope = RT_SCOPE_HOST;
} }
......
...@@ -325,7 +325,7 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock, ...@@ -325,7 +325,7 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
{ {
/* Real hardware Econet. We're not worthy etc. */ /* Real hardware Econet. We're not worthy etc. */
#ifdef CONFIG_ECONET_NATIVE #ifdef CONFIG_ECONET_NATIVE
atomic_inc(&dev->refcnt); dev_hold(dev);
skb = sock_alloc_send_skb(sk, len+dev->hard_header_len+15, skb = sock_alloc_send_skb(sk, len+dev->hard_header_len+15,
msg->msg_flags & MSG_DONTWAIT, &err); msg->msg_flags & MSG_DONTWAIT, &err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment