Re: [PATCH linux] netfilter: Remove unnecessary ret assignment

From: Florian Westphal
Date: Thu Dec 30 2021 - 07:13:43 EST


cgel.zte@xxxxxxxxx <cgel.zte@xxxxxxxxx> wrote:
> From: luo penghao <luo.penghao@xxxxxxxxxx>
>
> Regardless of whether the subsequent (copy_to_user(user, &info, *len) != 0)
> holds, the value of ret will be assigned a new value.
>
> The clang_analyzer complains as follows:
>
> net/ipv6/netfilter/ip6_tables.c:
>
> Value stored to 'ret' is never read

Please fix this properly:

1. consider adding error unwinding instead.
2. net/ipv4/netfilter/ip_tables.c has same construct