]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, lpm: fix kfree of im_node in trie_update_elem
authorDaniel Borkmann <daniel@iogearbox.net>
Tue, 24 Jan 2017 00:26:46 +0000 (01:26 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Jan 2017 02:17:35 +0000 (21:17 -0500)
commit19d20edbe284dc35c6c2b3aeb157fc65615e8961
tree808db68eb4959518023d42be3657e90162f28457
parentde35e42b0b9437d7deccc34d3d50d8597e5bfbdc
bpf, lpm: fix kfree of im_node in trie_update_elem

We need to initialize im_node to NULL, otherwise in case of error path
it gets passed to kfree() as uninitialized pointer.

Fixes: 4addca80fb90 ("bpf: add a longest prefix match trie map implementation")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/bpf/lpm_trie.c