提交 40c71f76 编写于 作者: M Matthieu Baerts 提交者: Paolo Abeni

mptcp: userspace pm: use a single point of exit

Like in all other functions in this file, a single point of exit is used
when extra operations are needed: unlock, decrement refcount, etc.

There is no functional change for the moment but it is better to do the
same here to make sure all cleanups are done in case of intermediate
errors.
Reviewed-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: NMatthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
上级 ad349374
...@@ -59,8 +59,8 @@ int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk, ...@@ -59,8 +59,8 @@ int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk,
*/ */
e = sock_kmalloc(sk, sizeof(*e), GFP_ATOMIC); e = sock_kmalloc(sk, sizeof(*e), GFP_ATOMIC);
if (!e) { if (!e) {
spin_unlock_bh(&msk->pm.lock); ret = -ENOMEM;
return -ENOMEM; goto append_err;
} }
*e = *entry; *e = *entry;
...@@ -74,6 +74,7 @@ int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk, ...@@ -74,6 +74,7 @@ int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk,
ret = entry->addr.id; ret = entry->addr.id;
} }
append_err:
spin_unlock_bh(&msk->pm.lock); spin_unlock_bh(&msk->pm.lock);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册