Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171182
b: refs/heads/master
c: bf8e56b
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 6, 2009
1 parent 5e67ad8 commit fdb27ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 69df9d5993bd7dd7499ad0e98fe824147fbe5667
refs/heads/master: bf8e56bfc4fcfcef9f08e6233dc619706807893a
10 changes: 6 additions & 4 deletions trunk/net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,16 @@ static int sock_bindtodevice(struct sock *sk, char __user *optval, int optlen)
if (devname[0] == '\0') {
index = 0;
} else {
struct net_device *dev = dev_get_by_name(net, devname);
struct net_device *dev;

rcu_read_lock();
dev = dev_get_by_name_rcu(net, devname);
if (dev)
index = dev->ifindex;
rcu_read_unlock();
ret = -ENODEV;
if (!dev)
goto out;

index = dev->ifindex;
dev_put(dev);
}

lock_sock(sk);
Expand Down

0 comments on commit fdb27ef

Please sign in to comment.