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

Commit ca8b634f authored by Mike Snitzer's avatar Mike Snitzer Committed by Greg Kroah-Hartman
Browse files

dm integrity: call kmem_cache_destroy() in dm_integrity_init() error path



commit 6b79a428c02769f2a11f8ae76bf866226d134887 upstream.

Otherwise the journal_io_cache will leak if dm_register_target() fails.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5a50e842
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -3689,13 +3689,15 @@ int __init dm_integrity_init(void)
	}

	r = dm_register_target(&integrity_target);

	if (r < 0)
	if (r < 0) {
		DMERR("register failed %d", r);

		kmem_cache_destroy(journal_io_cache);
		return r;
	}

	return 0;
}

void dm_integrity_exit(void)
{
	dm_unregister_target(&integrity_target);