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: Xiu Jianfeng <xiujianfeng@huawei.com>
Link: https://lore.kernel.org/r/20220519062932.249926-1-xiujianfeng@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Xiu Jianfeng 2022-05-19 14:29:32 +08:00 committed by Jakub Kicinski
parent f7b5a89c66
commit 29849a486a
1 changed files with 3 additions and 6 deletions

View File

@ -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);
}
}