Skip to content

Commit

Permalink
md-cluster: remove inappropriate try_module_get from join()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
NeilBrown committed Aug 31, 2015
1 parent 6022e75 commit 18b9f67
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/md/md-cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -771,7 +768,6 @@ static int join(struct mddev *mddev, int nodes)
dlm_release_lockspace(cinfo->lockspace, 2);
mddev->cluster_info = NULL;
kfree(cinfo);
module_put(THIS_MODULE);
return ret;
}

Expand Down

0 comments on commit 18b9f67

Please sign in to comment.