summaryrefslogtreecommitdiff
path: root/kernel/bpf/sockmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/bpf/sockmap.c')
-rw-r--r--kernel/bpf/sockmap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
index 78b2bb9370ac..617c239590c2 100644
--- a/kernel/bpf/sockmap.c
+++ b/kernel/bpf/sockmap.c
@@ -368,12 +368,12 @@ static int smap_read_sock_done(struct strparser *strp, int err)
static int smap_init_sock(struct smap_psock *psock,
struct sock *sk)
{
- struct strp_callbacks cb;
+ static const struct strp_callbacks cb = {
+ .rcv_msg = smap_read_sock_strparser,
+ .parse_msg = smap_parse_func_strparser,
+ .read_sock_done = smap_read_sock_done,
+ };
- memset(&cb, 0, sizeof(cb));
- cb.rcv_msg = smap_read_sock_strparser;
- cb.parse_msg = smap_parse_func_strparser;
- cb.read_sock_done = smap_read_sock_done;
return strp_init(&psock->strp, sk, &cb);
}