aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/sock.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/sock.c')
-rw-r--r--net/core/sock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index a31455dc702..4ed9b507c1e 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -367,6 +367,7 @@ static int sock_bindtodevice(struct sock *sk, char __user *optval, int optlen)
367{ 367{
368 int ret = -ENOPROTOOPT; 368 int ret = -ENOPROTOOPT;
369#ifdef CONFIG_NETDEVICES 369#ifdef CONFIG_NETDEVICES
370 struct net *net = sk->sk_net;
370 char devname[IFNAMSIZ]; 371 char devname[IFNAMSIZ];
371 int index; 372 int index;
372 373
@@ -395,7 +396,7 @@ static int sock_bindtodevice(struct sock *sk, char __user *optval, int optlen)
395 if (devname[0] == '\0') { 396 if (devname[0] == '\0') {
396 index = 0; 397 index = 0;
397 } else { 398 } else {
398 struct net_device *dev = dev_get_by_name(devname); 399 struct net_device *dev = dev_get_by_name(net, devname);
399 400
400 ret = -ENODEV; 401 ret = -ENODEV;
401 if (!dev) 402 if (!dev)