summaryrefslogtreecommitdiff
path: root/tools/lib/api/debug.c
diff options
context:
space:
mode:
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>2024-06-05 11:21:17 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-06-16 13:51:06 +0200
commitff577796d3ebe73087b898db7d436be9162df81c (patch)
treee3966ab7471e533907379624aaab41478941099f /tools/lib/api/debug.c
parentdc4c3f0ceba4c1fa9a258ea2e4cab19781add4d0 (diff)
selftests: net: lib: avoid error removing empty netns name
commit 79322174bcc780b99795cb89d237b26006a8b94b upstream. If there is an error to create the first netns with 'setup_ns()', 'cleanup_ns()' will be called with an empty string as first parameter. The consequences is that 'cleanup_ns()' will try to delete an invalid netns, and wait 20 seconds if the netns list is empty. Instead of just checking if the name is not empty, convert the string separated by spaces to an array. Manipulating the array is cleaner, and calling 'cleanup_ns()' with an empty array will be a no-op. Fixes: 25ae948b4478 ("selftests/net: add lib.sh") Cc: stable@vger.kernel.org Acked-by: Geliang Tang <geliang@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Reviewed-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Hangbin Liu <liuhangbin@gmail.com> Link: https://lore.kernel.org/r/20240605-upstream-net-20240605-selftests-net-lib-fixes-v1-2-b3afadd368c9@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/lib/api/debug.c')
0 files changed, 0 insertions, 0 deletions