Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <fengguang.wu@intel.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

+3 -1
+3 -1
net/sunrpc/auth_gss/gss_mech_switch.c
··· 257 257 spin_lock(&registered_mechs_lock); 258 258 list_for_each_entry(pos, &registered_mechs, gm_list) { 259 259 for (j = 0; j < pos->gm_pf_num; j++) { 260 - if (i >= size) 260 + if (i >= size) { 261 + spin_unlock(&registered_mechs_lock); 261 262 return -ENOMEM; 263 + } 262 264 array_ptr[i++] = pos->gm_pfs[j].pseudoflavor; 263 265 } 264 266 }