SUNRPC: Fix a module reference issue in rpcsec_gss
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 18 May 2014 17:47:14 +0000 (13:47 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 18 May 2014 17:47:14 +0000 (13:47 -0400)
We're not taking a reference in the case where _gss_mech_get_by_pseudoflavor
loops without finding the correct rpcsec_gss flavour, so why are we
releasing it?

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
net/sunrpc/auth_gss/gss_mech_switch.c

index 27ce2624093217d9f3233e19ccd8062f5c2c960f..92d5ab99fbf3d3072063c3f611931ab2a9826fc9 100644 (file)
@@ -218,10 +218,8 @@ static struct gss_api_mech *_gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
 
        spin_lock(&registered_mechs_lock);
        list_for_each_entry(pos, &registered_mechs, gm_list) {
-               if (!mech_supports_pseudoflavor(pos, pseudoflavor)) {
-                       module_put(pos->gm_owner);
+               if (!mech_supports_pseudoflavor(pos, pseudoflavor))
                        continue;
-               }
                if (try_module_get(pos->gm_owner))
                        gm = pos;
                break;