summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2023-04-04 18:59:00 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-11 17:03:41 +0300
commit21d5198c210c3c8768be8f7e0c1e6dff6ea7259d (patch)
tree968995f74a2b52d9cddfef02adfac98039465be6 /drivers/md
parent1da79e01e403b35c129b9889507a9869d21e1c82 (diff)
downloadlinux-21d5198c210c3c8768be8f7e0c1e6dff6ea7259d.tar.xz
dm clone: call kmem_cache_destroy() in dm_clone_init() error path
commit 6827af4a9a9f5bb664c42abf7c11af4978d72201 upstream. Otherwise the _hydration_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>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-clone-target.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm-clone-target.c b/drivers/md/dm-clone-target.c
index 29e0b85eeaf0..e088081b7a8a 100644
--- a/drivers/md/dm-clone-target.c
+++ b/drivers/md/dm-clone-target.c
@@ -2205,6 +2205,7 @@ static int __init dm_clone_init(void)
r = dm_register_target(&clone_target);
if (r < 0) {
DMERR("Failed to register clone target");
+ kmem_cache_destroy(_hydration_cache);
return r;
}