]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: use sock_kmemdup for ip_options
authorGeliang Tang <tanggeliang@kylinos.cn>
Fri, 28 Feb 2025 10:01:32 +0000 (18:01 +0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 4 Mar 2025 01:16:34 +0000 (17:16 -0800)
commit483cec55c1ccb9deeefb515fbeb181f736c41736
tree3316a845f6d562b1cc0de86f585e802227faedae
parent456cc675b6d4cadd4872a477d8976ff56eef4b6f
net: use sock_kmemdup for ip_options

Instead of using sock_kmalloc() to allocate an ip_options and then
immediately duplicate another ip_options to the newly allocated one in
ipv6_dup_options(), mptcp_copy_ip_options() and sctp_v4_copy_ip_options(),
the newly added sock_kmemdup() helper can be used to simplify the code.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Acked-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/91ae749d66600ec6fb679e0e518fda6acb5c3e6f.1740735165.git.tanggeliang@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/exthdrs.c
net/mptcp/protocol.c
net/sctp/protocol.c