Commit 29849a48 authored by Xiu Jianfeng's avatar Xiu Jianfeng Committed by Jakub Kicinski

stcp: Use memset_after() to zero sctp_stream_out_ext

Use memset_after() helper to simplify the code, there is no functional
change in this patch.
Signed-off-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
Link: https://lore.kernel.org/r/20220519062932.249926-1-xiujianfeng@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent f7b5a89c
......@@ -146,14 +146,11 @@ int sctp_sched_set_sched(struct sctp_association *asoc,
/* Give the next scheduler a clean slate. */
for (i = 0; i < asoc->stream.outcnt; i++) {
void *p = SCTP_SO(&asoc->stream, i)->ext;
struct sctp_stream_out_ext *ext = SCTP_SO(&asoc->stream, i)->ext;
if (!p)
if (!ext)
continue;
p += offsetofend(struct sctp_stream_out_ext, outq);
memset(p, 0, sizeof(struct sctp_stream_out_ext) -
offsetofend(struct sctp_stream_out_ext, outq));
memset_after(ext, 0, outq);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment