libbpf: Fix potential NULL pointer dereference
authorCiara Loftus <ciara.loftus@intel.com>
Thu, 8 Apr 2021 05:20:09 +0000 (05:20 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 8 Apr 2021 21:36:46 +0000 (23:36 +0200)
commitafd0be7299533bb2e2b09104399d8a467ecbd2c5
treec6daed3ba58f8fff559c91d57623889d1aac7b71
parent1ffbc7ea91606e4abd10eb60de5367f1c86daf5e
libbpf: Fix potential NULL pointer dereference

Wait until after the UMEM is checked for null to dereference it.

Fixes: 43f1bc1efff1 ("libbpf: Restore umem state after socket create failure")
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210408052009.7844-1-ciara.loftus@intel.com
tools/lib/bpf/xsk.c