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:
parent
f7b5a89c66
commit
29849a486a
|
@ -146,14 +146,11 @@ int sctp_sched_set_sched(struct sctp_association *asoc,
|
||||||
|
|
||||||
/* Give the next scheduler a clean slate. */
|
/* Give the next scheduler a clean slate. */
|
||||||
for (i = 0; i < asoc->stream.outcnt; i++) {
|
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;
|
continue;
|
||||||
|
memset_after(ext, 0, outq);
|
||||||
p += offsetofend(struct sctp_stream_out_ext, outq);
|
|
||||||
memset(p, 0, sizeof(struct sctp_stream_out_ext) -
|
|
||||||
offsetofend(struct sctp_stream_out_ext, outq));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue