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: Mike Snitzer <snitzer@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
717ceb487b
commit
44f29e93a5
@@ -4481,11 +4481,13 @@ static int __init dm_integrity_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
r = dm_register_target(&integrity_target);
|
r = dm_register_target(&integrity_target);
|
||||||
|
if (r < 0) {
|
||||||
if (r < 0)
|
|
||||||
DMERR("register failed %d", r);
|
DMERR("register failed %d", r);
|
||||||
|
kmem_cache_destroy(journal_io_cache);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
return r;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __exit dm_integrity_exit(void)
|
static void __exit dm_integrity_exit(void)
|
||||||
|
|||||||
Reference in New Issue
Block a user