]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sctp: no need to check assoc id before calling sctp_assoc_set_id
authorXin Long <lucien.xin@gmail.com>
Sat, 10 Jun 2017 07:27:12 +0000 (15:27 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Jun 2017 20:23:31 +0000 (16:23 -0400)
sctp_assoc_set_id does the assoc id check in the beginning when
processing dupcookie, no need to do the same check before calling
it.

v1->v2:
  fix some typo errs Marcelo pointed in changelog.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/associola.c

index 288c5e0cda5d1f89fffe40279ae8a1610acd56b8..72b07dd9b9595cb76326fb60919f462f3cecbd3a 100644 (file)
@@ -1181,12 +1181,8 @@ void sctp_assoc_update(struct sctp_association *asoc,
                if (sctp_state(asoc, COOKIE_WAIT))
                        sctp_stream_update(&asoc->stream, &new->stream);
 
-               if (!asoc->assoc_id) {
-                       /* get a new association id since we don't have one
-                        * yet.
-                        */
-                       sctp_assoc_set_id(asoc, GFP_ATOMIC);
-               }
+               /* get a new assoc id if we don't have one yet. */
+               sctp_assoc_set_id(asoc, GFP_ATOMIC);
        }
 
        /* SCTP-AUTH: Save the peer parameters from the new associations