Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 013448c5 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

SUNRPC: Add a missing spin_unlock to gss_mech_list_pseudoflavors



The patch "SUNRPC: Add rpcauth_list_flavors()" introduces a new error
path in gss_mech_list_pseudoflavors, but fails to release the spin lock.

Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent ec409897
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -257,8 +257,10 @@ int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr, int size)
	spin_lock(&registered_mechs_lock);
	list_for_each_entry(pos, &registered_mechs, gm_list) {
		for (j = 0; j < pos->gm_pf_num; j++) {
			if (i >= size)
			if (i >= size) {
				spin_unlock(&registered_mechs_lock);
				return -ENOMEM;
			}
			array_ptr[i++] = pos->gm_pfs[j].pseudoflavor;
		}
	}