dm cache: destroy migration_cache if cache target registration failed
authorShenghui Wang <shhuiw@foxmail.com>
Sun, 7 Oct 2018 06:45:41 +0000 (14:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Oct 2018 07:16:24 +0000 (09:16 +0200)
commit6c8faa19e9cc5fc0010737a2de38ad6b477bea30
tree2aada83f7f1fa0fa9e2b554debb5a8af0cd0afd4
parent8d2f62cb2d463456a4dbc84c59d1d2a05947fe20
dm cache: destroy migration_cache if cache target registration failed

commit c7cd55504a5b0fc826a2cd9540845979d24ae542 upstream.

Commit 7e6358d244e47 ("dm: fix various targets to dm_register_target
after module __init resources created") inadvertently introduced this
bug when it moved dm_register_target() after the call to KMEM_CACHE().

Fixes: 7e6358d244e47 ("dm: fix various targets to dm_register_target after module __init resources created")
Cc: stable@vger.kernel.org
Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-cache-target.c