提交 3716f8b5 编写于 作者: D Dong Chenchen 提交者: zhangchangzhong

net: sctp: update stream->incnt after successful allocation of stream_in

hulk inclusion
category: bugfix
bugzilla: 188766, https://gitee.com/openeuler/kernel/issues/I72J0M
CVE: NA

----------------------------------------

The stream->incnt is used to record number of stream_in.
sctp_stream_alloc_in() allocate array of incnt size for sctp_stream_in.
If array is allocated successfully in sctp_stream_init(), stream->incnt
should be updated with variable incnt.

Fixes: 703397c7 ("sctp: leave the err path free in sctp_stream_init to sctp_stream_free")
Signed-off-by: NDong Chenchen <dongchenchen2@huawei.com>
Reviewed-by: NLiu Jian <liujian56@huawei.com>
Signed-off-by: NZhang Changzhong <zhangchangzhong@huawei.com>
上级 18e10983
......@@ -242,7 +242,11 @@ int sctp_stream_init(struct sctp_stream *stream, __u16 outcnt, __u16 incnt,
if (!incnt)
return 0;
return sctp_stream_alloc_in(stream, incnt, gfp);
ret = sctp_stream_alloc_in(stream, incnt, gfp);
if (!ret)
stream->incnt = incnt;
return ret;
}
int sctp_stream_init_ext(struct sctp_stream *stream, __u16 sid)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册