]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
netfilter: ctnetlink: do not erase error code with EINVAL
authorFlorent Fourcot <florent.fourcot@wifirst.fr>
Wed, 3 Nov 2021 22:21:55 +0000 (23:21 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:48:59 +0000 (09:48 +0100)
BugLink: https://bugs.launchpad.net/bugs/1953370
[ Upstream commit 77522ff02f333434612bd72df9b376f8d3836e4d ]

And be consistent in error management for both orig/reply filtering

Fixes: cb8aa9a3affb ("netfilter: ctnetlink: add kernel side filtering for dump")
Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
net/netfilter/nf_conntrack_netlink.c

index a07f29deeec1ccddb10646c274f8be928605286e..472bb7933368beff23ea5d5fc60034f0d062752f 100644 (file)
@@ -1022,10 +1022,8 @@ ctnetlink_alloc_filter(const struct nlattr * const cda[], u8 family)
                                                   filter->family,
                                                   &filter->zone,
                                                   filter->reply_flags);
-               if (err < 0) {
-                       err = -EINVAL;
+               if (err < 0)
                        goto err_filter;
-               }
        }
 
        return filter;