Commit 1b0fd1e2 authored by Jonathan Brassow's avatar Jonathan Brassow Committed by Greg Kroah-Hartman

dm snapshot: free exception store on init failure

commit 034a186d 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: default avatarJonathan Brassow <jbrassow@redhat.com>
Reviewed-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Reviewed-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent af57e833
...@@ -1465,7 +1465,7 @@ static int __init dm_snapshot_init(void) ...@@ -1465,7 +1465,7 @@ static int __init dm_snapshot_init(void)
r = dm_register_target(&snapshot_target); r = dm_register_target(&snapshot_target);
if (r) { if (r) {
DMERR("snapshot target register failed %d", r); DMERR("snapshot target register failed %d", r);
return r; goto bad_register_snapshot_target;
} }
r = dm_register_target(&origin_target); r = dm_register_target(&origin_target);
...@@ -1522,6 +1522,9 @@ bad2: ...@@ -1522,6 +1522,9 @@ bad2:
dm_unregister_target(&origin_target); dm_unregister_target(&origin_target);
bad1: bad1:
dm_unregister_target(&snapshot_target); dm_unregister_target(&snapshot_target);
bad_register_snapshot_target:
dm_exception_store_exit();
return r; return r;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment