]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Fix compilation warning in __bpf_lru_list_rotate_inactive
authorMartin KaFai Lau <kafai@fb.com>
Tue, 15 Nov 2016 19:00:04 +0000 (11:00 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Nov 2016 16:30:56 +0000 (11:30 -0500)
commit858d93653421d6d0e5cb14091bc6d5f35ffc9a2c
treea91b2a4ee9f933c0d4960e8145c735d263992efd
parentfdc588a7f6045887a75fdd4c4d7d53d312f54b39
bpf: Fix compilation warning in __bpf_lru_list_rotate_inactive

gcc-6.2.1 gives the following warning:
kernel/bpf/bpf_lru_list.c: In function ‘__bpf_lru_list_rotate_inactive.isra.3’:
kernel/bpf/bpf_lru_list.c:201:28: warning: ‘next’ may be used uninitialized in this function [-Wmaybe-uninitialized]

The "next" is currently initialized in the while() loop which must have >=1
iterations.

This patch initializes next to get rid of the compiler warning.

Fixes: 5310743b1978 ("bpf: LRU List")
Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/bpf/bpf_lru_list.c