aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Brassow <[email protected]>2009-10-16 23:18:14 +0100
committerAlasdair G Kergon <[email protected]>2009-10-16 23:18:14 +0100
commit034a186d29dbcef099e57ab23ec39440596be911 (patch)
treeab7b134d082581dd11fd9894f37d109d5d7a34b7
parent6d45d93ead319423099b82a4efd775bc0f159121 (diff)
dm snapshot: free exception store on init failure
While initializing the snapshot module, if we fail to register the snapshot target then we must back-out the exception store module initialization. Cc: [email protected] Signed-off-by: Jonathan Brassow <[email protected]> Reviewed-by: Mikulas Patocka <[email protected]> Reviewed-by: Mike Snitzer <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
-rw-r--r--drivers/md/dm-snap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 3a53a5a9bec8..53f4063f7ea4 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -1470,7 +1470,7 @@ static int __init dm_snapshot_init(void)
r = dm_register_target(&snapshot_target);
if (r) {
DMERR("snapshot target register failed %d", r);
- return r;
+ goto bad_register_snapshot_target;
}
r = dm_register_target(&origin_target);
@@ -1527,6 +1527,9 @@ bad2:
dm_unregister_target(&origin_target);
bad1:
dm_unregister_target(&snapshot_target);
+
+bad_register_snapshot_target:
+ dm_exception_store_exit();
return r;
}