md-cluster: remove inappropriate try_module_get from join()
authorNeilBrown <neilb@suse.com>
Fri, 14 Aug 2015 00:22:00 +0000 (10:22 +1000)
committerNeilBrown <neilb@suse.com>
Mon, 31 Aug 2015 17:43:17 +0000 (19:43 +0200)
md_setup_cluster already calls try_module_get(), so this
try_module_get isn't needed.
Also, there is no matching module_put (except in error patch),
so this leaves an unbalanced module count.

Signed-off-by: NeilBrown <neilb@suse.com>
drivers/md/md-cluster.c

index c35a03a..11e3bc9 100644 (file)
@@ -687,9 +687,6 @@ static int join(struct mddev *mddev, int nodes)
        int ret, ops_rv;
        char str[64];
 
-       if (!try_module_get(THIS_MODULE))
-               return -ENOENT;
-
        cinfo = kzalloc(sizeof(struct md_cluster_info), GFP_KERNEL);
        if (!cinfo)
                return -ENOMEM;
@@ -771,7 +768,6 @@ err:
                dlm_release_lockspace(cinfo->lockspace, 2);
        mddev->cluster_info = NULL;
        kfree(cinfo);
-       module_put(THIS_MODULE);
        return ret;
 }