Commit 40c71f76 authored by Matthieu Baerts's avatar Matthieu Baerts Committed by 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: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment