From 013448c59b8a8cf71a5ff89641f78b620671ccb0 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Tue, 17 Jul 2012 14:47:30 -0400 Subject: 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: Fengguang Wu Signed-off-by: Trond Myklebust --- net/sunrpc/auth_gss/gss_mech_switch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c index 6ac5dfcd2928..b174fcd9ff4c 100644 --- a/net/sunrpc/auth_gss/gss_mech_switch.c +++ b/net/sunrpc/auth_gss/gss_mech_switch.c @@ -257,8 +257,10 @@ int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr, int size) spin_lock(®istered_mechs_lock); list_for_each_entry(pos, ®istered_mechs, gm_list) { for (j = 0; j < pos->gm_pf_num; j++) { - if (i >= size) + if (i >= size) { + spin_unlock(®istered_mechs_lock); return -ENOMEM; + } array_ptr[i++] = pos->gm_pfs[j].pseudoflavor; } } -- cgit v1.2.3-58-ga151