[PATCH mptcp-next v5 07/12] mptcp: remove assigned but unused value

Matthieu Baerts posted 12 patches 3 years, 1 month ago
Maintainers: Mat Martineau <mathew.j.martineau@linux.intel.com>, Matthieu Baerts <matthieu.baerts@tessares.net>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>, Kishen Maloor <kishen.maloor@intel.com>, Florian Westphal <fw@strlen.de>
[PATCH mptcp-next v5 07/12] mptcp: remove assigned but unused value
Posted by Matthieu Baerts 3 years, 1 month ago
'ret' is always set later before being used.

Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
 net/mptcp/pm_userspace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index ea6ad9da7493..be389dad3f0a 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -34,7 +34,7 @@ int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk,
 	struct mptcp_pm_addr_entry *e;
 	bool addr_match = false;
 	bool id_match = false;
-	int ret = -EINVAL;
+	int ret;
 
 	bitmap_zero(id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1);
 
-- 
2.37.2
Re: [PATCH mptcp-next v5 07/12] mptcp: remove assigned but unused value
Posted by Matthieu Baerts 3 years, 1 month ago
Hello,

On 04/01/2023 18:15, Matthieu Baerts wrote:
> 'ret' is always set later before being used.
> 
> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
> ---
>  net/mptcp/pm_userspace.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
> index ea6ad9da7493..be389dad3f0a 100644
> --- a/net/mptcp/pm_userspace.c
> +++ b/net/mptcp/pm_userspace.c
> @@ -34,7 +34,7 @@ int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk,
>  	struct mptcp_pm_addr_entry *e;
>  	bool addr_match = false;
>  	bool id_match = false;
> -	int ret = -EINVAL;
> +	int ret;

I don't know how I got the warning nor how I missed that but as reported
by the kernel test robot, "ret" could be used unassigned below. So I'm
going to revert this patch directly in our tree, sorry for the noise.

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net