[PATCH -next] stcp: Use memset_after() to zero sctp_stream_out_ext

Subsystems: networking [general], sctp protocol, the rest

STALE1533d LANDED

Landed in mainline as 29849a486a85 on 2022-05-21.

2 messages, 2 authors, 2022-05-21 · open the first message on its own page

[PATCH -next] stcp: Use memset_after() to zero sctp_stream_out_ext

From: Xiu Jianfeng <xiujianfeng@huawei.com>
Date: 2022-05-19 06:31:25

Use memset_after() helper to simplify the code, there is no functional
change in this patch.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
 net/sctp/stream_sched.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/net/sctp/stream_sched.c b/net/sctp/stream_sched.c
index 99e5f69fbb74..518b1b9bf89d 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);
 		}
 	}
 
-- 
2.17.1

Re: [PATCH -next] stcp: Use memset_after() to zero sctp_stream_out_ext

From: patchwork-bot+netdevbpf@kernel.org
Date: 2022-05-21 00:50:19

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski [off-list ref]:

On Thu, 19 May 2022 14:29:32 +0800 you wrote:
Use memset_after() helper to simplify the code, there is no functional
change in this patch.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
 net/sctp/stream_sched.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
Here is the summary with links:
  - [-next] stcp: Use memset_after() to zero sctp_stream_out_ext
    https://git.kernel.org/netdev/net-next/c/29849a486a85

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help