Skip to content

Commit 09cb47a

Browse files
Julia Lawalldavem330
authored andcommitted
net/sctp: Eliminate useless code
The variable newinet is initialized twice to the same (side effect-free) expression. Drop one initialization. A simplified version of the semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // <smpl> @forall@ idexpression *x; identifier f!=ERR_PTR; @@ x = f(...) ... when != x ( x = f(...,<+...x...+>,...) | * x = f(...) ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Acked-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 17660f8 commit 09cb47a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sctp/socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6359,7 +6359,7 @@ void sctp_copy_sock(struct sock *newsk, struct sock *sk,
63596359
struct sctp_association *asoc)
63606360
{
63616361
struct inet_sock *inet = inet_sk(sk);
6362-
struct inet_sock *newinet = inet_sk(newsk);
6362+
struct inet_sock *newinet;
63636363

63646364
newsk->sk_type = sk->sk_type;
63656365
newsk->sk_bound_dev_if = sk->sk_bound_dev_if;

0 commit comments

Comments
 (0)