diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2009-10-16 18:18:14 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-10-16 18:18:14 -0400 |
commit | 034a186d29dbcef099e57ab23ec39440596be911 (patch) | |
tree | ab7b134d082581dd11fd9894f37d109d5d7a34b7 /drivers | |
parent | 6d45d93ead319423099b82a4efd775bc0f159121 (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: stable@kernel.org
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>
Diffstat (limited to 'drivers')
-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 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) | |||
1470 | r = dm_register_target(&snapshot_target); | 1470 | r = dm_register_target(&snapshot_target); |
1471 | if (r) { | 1471 | if (r) { |
1472 | DMERR("snapshot target register failed %d", r); | 1472 | DMERR("snapshot target register failed %d", r); |
1473 | return r; | 1473 | goto bad_register_snapshot_target; |
1474 | } | 1474 | } |
1475 | 1475 | ||
1476 | r = dm_register_target(&origin_target); | 1476 | r = dm_register_target(&origin_target); |
@@ -1527,6 +1527,9 @@ bad2: | |||
1527 | dm_unregister_target(&origin_target); | 1527 | dm_unregister_target(&origin_target); |
1528 | bad1: | 1528 | bad1: |
1529 | dm_unregister_target(&snapshot_target); | 1529 | dm_unregister_target(&snapshot_target); |
1530 | |||
1531 | bad_register_snapshot_target: | ||
1532 | dm_exception_store_exit(); | ||
1530 | return r; | 1533 | return r; |
1531 | } | 1534 | } |
1532 | 1535 | ||