]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/sctp/sm_make_chunk.c
sctp: set new_asoc temp when processing dupcookie
[karo-tx-linux.git] / net / sctp / sm_make_chunk.c
index 118faff6a332ee24caf3d772b6f00641128ef104..92e332e173914f16c10ba54038dbb78dee0d0c49 100644 (file)
@@ -1512,14 +1512,12 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int len,
                          struct iov_iter *from)
 {
        void *target;
-       ssize_t copied;
 
        /* Make room in chunk for data.  */
        target = skb_put(chunk->skb, len);
 
        /* Copy data (whole iovec) into chunk */
-       copied = copy_from_iter(target, len, from);
-       if (copied != len)
+       if (!copy_from_iter_full(target, len, from))
                return -EFAULT;
 
        /* Adjust the chunk length field.  */
@@ -2456,16 +2454,11 @@ int sctp_process_init(struct sctp_association *asoc, struct sctp_chunk *chunk,
         * stream sequence number shall be set to 0.
         */
 
-       /* Allocate storage for the negotiated streams if it is not a temporary
-        * association.
-        */
-       if (!asoc->temp) {
-               if (sctp_stream_init(asoc, gfp))
-                       goto clean_up;
+       if (sctp_stream_init(asoc, gfp))
+               goto clean_up;
 
-               if (sctp_assoc_set_id(asoc, gfp))
-                       goto clean_up;
-       }
+       if (!asoc->temp && sctp_assoc_set_id(asoc, gfp))
+               goto clean_up;
 
        /* ADDIP Section 4.1 ASCONF Chunk Procedures
         *