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

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.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent f7b5a89c
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -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);
		}
	}