Skip to content

Commit 169ea3f

Browse files
Geliang Tangintel-lab-lkp
authored andcommitted
mptcp: drop info of userspace_pm_remove_id_zero_address
The only use of 'info' parameter of userspace_pm_remove_id_zero_address() is to set an error message into it. This patch drops this parameter and sets the error message where this function is called in mptcp_pm_nl_remove_doit(). Signed-off-by: Geliang Tang <[email protected]>
1 parent 2d5545e commit 169ea3f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

net/mptcp/pm_userspace.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,7 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info)
259259
return err;
260260
}
261261

262-
static int mptcp_userspace_pm_remove_id_zero_address(struct mptcp_sock *msk,
263-
struct genl_info *info)
262+
static int mptcp_userspace_pm_remove_id_zero_address(struct mptcp_sock *msk)
264263
{
265264
struct mptcp_rm_list list = { .nr = 0 };
266265
struct mptcp_subflow_context *subflow;
@@ -275,10 +274,8 @@ static int mptcp_userspace_pm_remove_id_zero_address(struct mptcp_sock *msk,
275274
break;
276275
}
277276
}
278-
if (!has_id_0) {
279-
GENL_SET_ERR_MSG(info, "address with id 0 not found");
277+
if (!has_id_0)
280278
goto remove_err;
281-
}
282279

283280
list.ids[list.nr++] = 0;
284281

@@ -336,7 +333,7 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info)
336333
sk = (struct sock *)msk;
337334

338335
if (id_val == 0) {
339-
err = mptcp_userspace_pm_remove_id_zero_address(msk, info);
336+
err = mptcp_userspace_pm_remove_id_zero_address(msk);
340337
goto out;
341338
}
342339

@@ -345,7 +342,6 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info)
345342
spin_lock_bh(&msk->pm.lock);
346343
match = mptcp_userspace_pm_lookup_addr_by_id(msk, id_val);
347344
if (!match) {
348-
GENL_SET_ERR_MSG(info, "address with specified id not found");
349345
spin_unlock_bh(&msk->pm.lock);
350346
release_sock(sk);
351347
goto out;
@@ -362,6 +358,11 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info)
362358

363359
err = 0;
364360
out:
361+
if (err)
362+
GENL_SET_ERR_MSG_FMT(info,
363+
"address with id %u not found",
364+
id_val);
365+
365366
sock_put(sk);
366367
return err;
367368
}

0 commit comments

Comments
 (0)