aboutsummaryrefslogtreecommitdiff
path: root/drivers/md/dm-cache-metadata.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman2020-09-14 10:10:55 +0200
committerGreg Kroah-Hartman2020-09-14 10:10:55 +0200
commitfccee0baced04636952cd580ddee4bb8cbb9544c (patch)
tree80e25c0e100246357bd0c0a93feb1bf2e5e5bd1d /drivers/md/dm-cache-metadata.c
parenta5a6d2753e7ec18a34bd21190b50ee7f085f4daf (diff)
parent856deb866d16e29bd65952e0289066f6078af773 (diff)
Merge 5.9-rc5 into usb-next
We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/md/dm-cache-metadata.c')
-rw-r--r--drivers/md/dm-cache-metadata.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c
index 151aa95775be..af6d4f898e4c 100644
--- a/drivers/md/dm-cache-metadata.c
+++ b/drivers/md/dm-cache-metadata.c
@@ -537,12 +537,16 @@ static int __create_persistent_data_objects(struct dm_cache_metadata *cmd,
CACHE_MAX_CONCURRENT_LOCKS);
if (IS_ERR(cmd->bm)) {
DMERR("could not create block manager");
- return PTR_ERR(cmd->bm);
+ r = PTR_ERR(cmd->bm);
+ cmd->bm = NULL;
+ return r;
}
r = __open_or_format_metadata(cmd, may_format_device);
- if (r)
+ if (r) {
dm_block_manager_destroy(cmd->bm);
+ cmd->bm = NULL;
+ }
return r;
}