netfilter: ctnetlink: do not erase error code with EINVAL

[ Upstream commit 77522ff02f ]

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

Fixes: cb8aa9a3af ("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>
This commit is contained in:
Florent Fourcot 2021-11-03 23:21:55 +01:00 committed by Greg Kroah-Hartman
parent 59a0088fde
commit 49f8783307
1 changed files with 1 additions and 3 deletions

View File

@ -1012,10 +1012,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;