]> git.ipfire.org Git - people/arne_f/kernel.git/blobdiff - net/sctp/stream.c
sctp: improve the events for sctp stream adding
[people/arne_f/kernel.git] / net / sctp / stream.c
index 61273534ae1052172e4280385674f4b572127acc..33fc0a651d336ead8417eed18a78cbcc9fa6f05b 100644 (file)
@@ -642,6 +642,16 @@ struct sctp_chunk *sctp_process_strreset_addstrm_out(
        if (!(asoc->strreset_enable & SCTP_ENABLE_CHANGE_ASSOC_REQ))
                goto out;
 
+       in = ntohs(addstrm->number_of_streams);
+       incnt = stream->incnt + in;
+       if (!in || incnt > SCTP_MAX_STREAM)
+               goto out;
+
+       streamin = krealloc(stream->in, incnt * sizeof(*streamin),
+                           GFP_ATOMIC);
+       if (!streamin)
+               goto out;
+
        if (asoc->strreset_chunk) {
                if (!sctp_chunk_lookup_strreset_param(
                        asoc, 0, SCTP_PARAM_RESET_ADD_IN_STREAMS)) {
@@ -665,16 +675,6 @@ struct sctp_chunk *sctp_process_strreset_addstrm_out(
                }
        }
 
-       in = ntohs(addstrm->number_of_streams);
-       incnt = stream->incnt + in;
-       if (!in || incnt > SCTP_MAX_STREAM)
-               goto out;
-
-       streamin = krealloc(stream->in, incnt * sizeof(*streamin),
-                           GFP_ATOMIC);
-       if (!streamin)
-               goto out;
-
        memset(streamin + stream->incnt, 0, in * sizeof(*streamin));
        stream->in = streamin;
        stream->incnt = incnt;
@@ -750,9 +750,6 @@ struct sctp_chunk *sctp_process_strreset_addstrm_in(
 
        result = SCTP_STRRESET_PERFORMED;
 
-       *evp = sctp_ulpevent_make_stream_change_event(asoc,
-               0, 0, ntohs(addstrm->number_of_streams), GFP_ATOMIC);
-
 out:
        sctp_update_strreset_result(asoc, result);
 err: