mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 23:21:46 +00:00
bpf: sockmap state change warning fix
psock will uninitialized in default case we need to do the same psock lookup
and check as in other branch. Fixes compile warning below.
kernel/bpf/sockmap.c: In function ‘smap_state_change’:
kernel/bpf/sockmap.c:156:21: warning: ‘psock’ may be used uninitialized in this function [-Wmaybe-uninitialized]
struct smap_psock *psock;
Fixes: 174a79ff95
("bpf: sockmap with sk redirect support")
Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d978db8dbe
commit
cf56e3b98c
1 changed files with 3 additions and 0 deletions
|
@ -188,6 +188,9 @@ static void smap_state_change(struct sock *sk)
|
||||||
smap_release_sock(sk);
|
smap_release_sock(sk);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
psock = smap_psock_sk(sk);
|
||||||
|
if (unlikely(!psock))
|
||||||
|
break;
|
||||||
smap_report_sk_error(psock, EPIPE);
|
smap_report_sk_error(psock, EPIPE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue