Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66db6cfd authored by Joseph Qi's avatar Joseph Qi Committed by Linus Torvalds
Browse files

ocfs2: fix double kmem_cache_destroy in dlm_init



In dlm_init, if create dlm_lockname_cache failed in
dlm_init_master_caches, it will destroy dlm_lockres_cache which created
before twice.  And this will cause system die when loading modules.

Signed-off-by: default avatarJoseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3e030ecc
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -472,11 +472,15 @@ int dlm_init_master_caches(void)

void dlm_destroy_master_caches(void)
{
	if (dlm_lockname_cache)
	if (dlm_lockname_cache) {
		kmem_cache_destroy(dlm_lockname_cache);
		dlm_lockname_cache = NULL;
	}

	if (dlm_lockres_cache)
	if (dlm_lockres_cache) {
		kmem_cache_destroy(dlm_lockres_cache);
		dlm_lockres_cache = NULL;
	}
}

static void dlm_lockres_release(struct kref *kref)