linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: unix: remove redundant assignment to variable 'err'
@ 2020-09-21  3:29 Jing Xiangfeng
  2020-09-21 21:52 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jing Xiangfeng @ 2020-09-21  3:29 UTC (permalink / raw)
  To: davem, kuba, ktkhai, pabeni, tklauser, steffen.klassert, cai,
	pankaj.laxminarayan.bharadiya, arnd, vcaputo, edumazet, sd
  Cc: netdev, linux-kernel, jingxiangfeng

After commit 37ab4fa7844a ("net: unix: allow bind to fail on mutex lock"),
the assignment to err is redundant. So remove it.

Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
---
 net/unix/af_unix.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 92784e51ee7d..eb82bdc6cf7c 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -878,7 +878,6 @@ static int unix_autobind(struct socket *sock)
 	if (err)
 		return err;
 
-	err = 0;
 	if (u->addr)
 		goto out;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: unix: remove redundant assignment to variable 'err'
  2020-09-21  3:29 [PATCH] net: unix: remove redundant assignment to variable 'err' Jing Xiangfeng
@ 2020-09-21 21:52 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-09-21 21:52 UTC (permalink / raw)
  To: jingxiangfeng
  Cc: kuba, ktkhai, pabeni, tklauser, steffen.klassert, cai,
	pankaj.laxminarayan.bharadiya, arnd, vcaputo, edumazet, sd,
	netdev, linux-kernel

From: Jing Xiangfeng <jingxiangfeng@huawei.com>
Date: Mon, 21 Sep 2020 11:29:52 +0800

> After commit 37ab4fa7844a ("net: unix: allow bind to fail on mutex lock"),
> the assignment to err is redundant. So remove it.
> 
> Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
 ...
> @@ -878,7 +878,6 @@ static int unix_autobind(struct socket *sock)
>  	if (err)
>  		return err;
>  
> -	err = 0;
>  	if (u->addr)
>  		goto out;

Yes, err is always zero here in this code path.

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-21 21:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-21  3:29 [PATCH] net: unix: remove redundant assignment to variable 'err' Jing Xiangfeng
2020-09-21 21:52 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).