selftests: bpf: test_sockmap: handle file creation failures gracefully
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 27 Nov 2019 20:16:45 +0000 (12:16 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Dec 2019 21:31:03 +0000 (22:31 +0100)
commit987daa48f8d84f02add8fd9fd5f1a8783159771e
tree5568901640ccb76ec1ca36c2d4e279c2cc9e547d
parent569cac5a50002a135c9d791a3bac73e70cba0450
selftests: bpf: test_sockmap: handle file creation failures gracefully

[ Upstream commit 4b67c515036313f3c3ecba3cb2babb9cbddb3f85 ]

test_sockmap creates a temporary file to use for sendpage.
this may fail for various reasons. Handle the error rather
than segfault.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/bpf/test_sockmap.c