Commit 6b79a428 authored by Mike Snitzer's avatar Mike Snitzer

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

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>
parent 6827af4a
......@@ -4703,11 +4703,13 @@ static 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 r;
return 0;
}
static void __exit dm_integrity_exit(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment