Skip to content

Commit

Permalink
dm snapshot: free exception store on init failure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Brassow authored and Alasdair G Kergon committed Oct 16, 2009
1 parent 6d45d93 commit 034a186
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/md/dm-snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -1527,6 +1527,9 @@ static int __init dm_snapshot_init(void)
dm_unregister_target(&origin_target);
bad1:
dm_unregister_target(&snapshot_target);

bad_register_snapshot_target:
dm_exception_store_exit();
return r;
}

Expand Down

0 comments on commit 034a186

Please sign in to comment.