From: Xiu Jianfeng Date: Thu, 19 May 2022 06:29:32 +0000 (+0800) Subject: stcp: Use memset_after() to zero sctp_stream_out_ext X-Git-Tag: v5.19-rc1~159^2~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=29849a486a85f7ab1f3b389db5e3d4948119bef2;p=thirdparty%2Flinux.git 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 Link: https://lore.kernel.org/r/20220519062932.249926-1-xiujianfeng@huawei.com Signed-off-by: Jakub Kicinski --- diff --git a/net/sctp/stream_sched.c b/net/sctp/stream_sched.c index 99e5f69fbb742..518b1b9bf89d6 100644 --- a/net/sctp/stream_sched.c +++ b/net/sctp/stream_sched.c @@ -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); } }