mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 03:06:10 +00:00
net: Fix build warning in sock_bindtodevice().
net/core/sock.c: In function 'sock_setsockopt': net/core/sock.c:396: warning: 'index' may be used uninitialized in this function net/core/sock.c:396: note: 'index' was declared here GCC can't see that all paths initialize index, so just set it to the default (0) and eliminate the specific code block that handles the null device name string. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
baac856454
commit
000ba2e43f
1 changed files with 2 additions and 3 deletions
|
@ -417,9 +417,8 @@ static int sock_bindtodevice(struct sock *sk, char __user *optval, int optlen)
|
|||
if (copy_from_user(devname, optval, optlen))
|
||||
goto out;
|
||||
|
||||
if (devname[0] == '\0') {
|
||||
index = 0;
|
||||
} else {
|
||||
index = 0;
|
||||
if (devname[0] != '\0') {
|
||||
struct net_device *dev;
|
||||
|
||||
rcu_read_lock();
|
||||
|
|
Loading…
Reference in a new issue