aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sctp/stream.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/sctp/stream.c b/net/sctp/stream.c
index a11db21dc8a0..09c797a10aaa 100644
--- a/net/sctp/stream.c
+++ b/net/sctp/stream.c
@@ -563,7 +563,7 @@ struct sctp_chunk *sctp_process_strreset_outreq(
563 flags = SCTP_STREAM_RESET_INCOMING_SSN; 563 flags = SCTP_STREAM_RESET_INCOMING_SSN;
564 } 564 }
565 565
566 nums = (ntohs(param.p->length) - sizeof(*outreq)) / 2; 566 nums = (ntohs(param.p->length) - sizeof(*outreq)) / sizeof(__u16);
567 if (nums) { 567 if (nums) {
568 str_p = outreq->list_of_streams; 568 str_p = outreq->list_of_streams;
569 for (i = 0; i < nums; i++) { 569 for (i = 0; i < nums; i++) {
@@ -627,7 +627,7 @@ struct sctp_chunk *sctp_process_strreset_inreq(
627 goto out; 627 goto out;
628 } 628 }
629 629
630 nums = (ntohs(param.p->length) - sizeof(*inreq)) / 2; 630 nums = (ntohs(param.p->length) - sizeof(*inreq)) / sizeof(__u16);
631 str_p = inreq->list_of_streams; 631 str_p = inreq->list_of_streams;
632 for (i = 0; i < nums; i++) { 632 for (i = 0; i < nums; i++) {
633 if (ntohs(str_p[i]) >= stream->outcnt) { 633 if (ntohs(str_p[i]) >= stream->outcnt) {
@@ -927,7 +927,8 @@ struct sctp_chunk *sctp_process_strreset_resp(
927 927
928 outreq = (struct sctp_strreset_outreq *)req; 928 outreq = (struct sctp_strreset_outreq *)req;
929 str_p = outreq->list_of_streams; 929 str_p = outreq->list_of_streams;
930 nums = (ntohs(outreq->param_hdr.length) - sizeof(*outreq)) / 2; 930 nums = (ntohs(outreq->param_hdr.length) - sizeof(*outreq)) /
931 sizeof(__u16);
931 932
932 if (result == SCTP_STRRESET_PERFORMED) { 933 if (result == SCTP_STRRESET_PERFORMED) {
933 if (nums) { 934 if (nums) {
@@ -956,7 +957,8 @@ struct sctp_chunk *sctp_process_strreset_resp(
956 957
957 inreq = (struct sctp_strreset_inreq *)req; 958 inreq = (struct sctp_strreset_inreq *)req;
958 str_p = inreq->list_of_streams; 959 str_p = inreq->list_of_streams;
959 nums = (ntohs(inreq->param_hdr.length) - sizeof(*inreq)) / 2; 960 nums = (ntohs(inreq->param_hdr.length) - sizeof(*inreq)) /
961 sizeof(__u16);
960 962
961 *evp = sctp_ulpevent_make_stream_reset_event(asoc, flags, 963 *evp = sctp_ulpevent_make_stream_reset_event(asoc, flags,
962 nums, str_p, GFP_ATOMIC); 964 nums, str_p, GFP_ATOMIC);