diff mbox series

net: unix: remove redundant assignment to variable 'err'

Message ID 20200921032952.99894-1-jingxiangfeng@huawei.com
State Accepted
Delegated to: David Miller
Headers show
Series net: unix: remove redundant assignment to variable 'err' | expand

Commit Message

Jing Xiangfeng Sept. 21, 2020, 3:29 a.m. UTC
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(-)

Comments

David Miller Sept. 21, 2020, 9:52 p.m. UTC | #1
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.
diff mbox series

Patch

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;