Message ID | 3e5a307aed213038a87e44ff93b5793229b16279.1740735165.git.tanggeliang@kylinos.cn (mailing list archive) |
---|---|
State | Accepted |
Commit | 52f83c0b5f857dbe24f66fc9a7f035523e9ffbc9 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | add sock_kmemdup helper | expand |
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 6bf6a20ef7f3..7e7d01bef5d4 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -71,13 +71,12 @@ static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk, /* Memory for the entry is allocated from the * sock option buffer. */ - e = sock_kmalloc(sk, sizeof(*e), GFP_ATOMIC); + e = sock_kmemdup(sk, entry, sizeof(*entry), GFP_ATOMIC); if (!e) { ret = -ENOMEM; goto append_err; } - *e = *entry; if (!e->addr.id && needs_id) e->addr.id = find_next_zero_bit(id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1,