diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2009-10-16 23:18:14 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-11-09 16:22:01 -0800 |
commit | 1b0fd1e25a9393003f7034a83f5932ce26242577 (patch) | |
tree | 81f59008ab4fe66d352d57d204d0461ca37ceab6 /drivers/md | |
parent | af57e833c96884bf0aa231039a25c853f7e83864 (diff) |
dm snapshot: free exception store on init failure
commit 034a186d29dbcef099e57ab23ec39440596be911 upstream.
While initializing the snapshot module, if we fail to register
the snapshot target then we must back-out the exception store
module initialization.
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-snap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 57f1bf7f3b7..a622f5d5f3e 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -1465,7 +1465,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); @@ -1522,6 +1522,9 @@ bad2: dm_unregister_target(&origin_target); bad1: dm_unregister_target(&snapshot_target); + +bad_register_snapshot_target: + dm_exception_store_exit(); return r; } |