net: dccp : proto: remove Unneeded variable "err"
authorHariprasad Kelam <hariprasad.kelam@gmail.com>
Sun, 12 May 2019 10:39:49 +0000 (16:09 +0530)
committerDavid S. Miller <davem@davemloft.net>
Sun, 12 May 2019 20:21:30 +0000 (13:21 -0700)
Fix below issue reported by coccicheck

net/dccp/proto.c:266:5-8: Unneeded variable: "err". Return "0" on line
310

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dccp/proto.c

index 0e2f71ab8367794ac3b059120713cb7495079ee2..5dd85ec51bfef3552dc6bfd3e7697bd42ef99bd6 100644 (file)
@@ -263,7 +263,6 @@ int dccp_disconnect(struct sock *sk, int flags)
        struct inet_connection_sock *icsk = inet_csk(sk);
        struct inet_sock *inet = inet_sk(sk);
        struct dccp_sock *dp = dccp_sk(sk);
-       int err = 0;
        const int old_state = sk->sk_state;
 
        if (old_state != DCCP_CLOSED)
@@ -307,7 +306,7 @@ int dccp_disconnect(struct sock *sk, int flags)
        WARN_ON(inet->inet_num && !icsk->icsk_bind_hash);
 
        sk->sk_error_report(sk);
-       return err;
+       return 0;
 }
 
 EXPORT_SYMBOL_GPL(dccp_disconnect);