diff options
author | Martin KaFai Lau <kafai@fb.com> | 2016-11-15 11:00:04 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-16 11:30:56 -0500 |
commit | 2874aa2e467dbc0b4f7cb0ee5dc872e98e000a47 (patch) | |
tree | a91b2a4ee9f933c0d4960e8145c735d263992efd /kernel/bpf/bpf_lru_list.c | |
parent | 46738b1317e169b281ad74690276916e24d1be6d (diff) |
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: 3a08c2fd7634 ("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>
Diffstat (limited to 'kernel/bpf/bpf_lru_list.c')
-rw-r--r-- | kernel/bpf/bpf_lru_list.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/bpf_lru_list.c b/kernel/bpf/bpf_lru_list.c index bfebff010ba9..89b7ef41c86b 100644 --- a/kernel/bpf/bpf_lru_list.c +++ b/kernel/bpf/bpf_lru_list.c @@ -170,7 +170,7 @@ static void __bpf_lru_list_rotate_inactive(struct bpf_lru *lru, struct bpf_lru_list *l) { struct list_head *inactive = &l->lists[BPF_LRU_LIST_T_INACTIVE]; - struct list_head *cur, *next, *last; + struct list_head *cur, *last, *next = inactive; struct bpf_lru_node *node; unsigned int i = 0; |