mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 14:42:24 +00:00
selftests/xsk: Add missing close() on netns fd
Commit1034b03e54
("selftests: xsk: Simplify cleanup of ifobjects") removed close on netns fd, which is not correct, so let us restore it. Fixes:1034b03e54
("selftests: xsk: Simplify cleanup of ifobjects") Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Magnus Karlsson <magnus.karlsson@intel.com> Link: https://lore.kernel.org/bpf/20220830133905.9945-1-maciej.fijalkowski@intel.com
This commit is contained in:
parent
c00c446168
commit
8a7d61bdc2
@ -1606,6 +1606,8 @@ static struct ifobject *ifobject_create(void)
|
||||
if (!ifobj->umem)
|
||||
goto out_umem;
|
||||
|
||||
ifobj->ns_fd = -1;
|
||||
|
||||
return ifobj;
|
||||
|
||||
out_umem:
|
||||
@ -1617,6 +1619,8 @@ out_xsk_arr:
|
||||
|
||||
static void ifobject_delete(struct ifobject *ifobj)
|
||||
{
|
||||
if (ifobj->ns_fd != -1)
|
||||
close(ifobj->ns_fd);
|
||||
free(ifobj->umem);
|
||||
free(ifobj->xsk_arr);
|
||||
free(ifobj);
|
||||
|
Loading…
Reference in New Issue
Block a user