diff options
| author | Nathan Chancellor <natechancellor@gmail.com> | 2017-01-26 15:37:28 -0700 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-13 12:32:04 +0200 |
| commit | 27f9328d209e9d12afe5e50aa55172b9d73356fe (patch) | |
| tree | bb7f691a232a8130e5013a14ad13513a8cf889cf /net | |
| parent | e5f041f336e566aef9823f6f7cbadee3f46bd6a7 (diff) | |
net: socket: fix maybe-uninitialized warnings
In file included from /home/nathan/Kernels/angler/arch/arm64/include/asm/bitops.h:49:0,
from include/linux/bitops.h:30,
from include/linux/kernel.h:10,
from include/asm-generic/bug.h:13,
from /home/nathan/Kernels/angler/arch/arm64/include/asm/bug.h:48,
from include/linux/bug.h:4,
from include/linux/thread_info.h:13,
from include/linux/preempt.h:9,
from include/linux/spinlock.h:50,
from include/linux/mmzone.h:7,
from include/linux/gfp.h:4,
from include/linux/mm.h:8,
from net/socket.c:61:
net/socket.c: In function 'SyS_socketpair':
include/asm-generic/bitops/non-atomic.h:105:20: warning: 'sock1' may be used uninitialized in this function [-Wmaybe-uninitialized]
return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
~~~~^~~~~~~~~~~~~~
net/socket.c:1433:17: note: 'sock1' was declared here
struct socket *sock1, *sock2;
^~~~~
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Diffstat (limited to 'net')
| -rw-r--r-- | net/socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/socket.c b/net/socket.c index e7d50116c..0644eaef1 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1440,7 +1440,7 @@ out_release: SYSCALL_DEFINE4(socketpair, int, family, int, type, int, protocol, int __user *, usockvec) { - struct socket *sock1, *sock2; + struct socket *sock1 = NULL, *sock2 = NULL; int fd1, fd2, err; struct file *newfile1, *newfile2; int flags; |
