diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2009-03-16 13:44:26 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-03-16 13:44:26 -0400 |
commit | f80a557008462a0a4adef25407f1872e793d8dd5 (patch) | |
tree | 41c0d0b924dc392adb413ef4ebe35bb42ef24727 /drivers | |
parent | bc0fd67feba2e0770aad85393500ba77c6489f1c (diff) |
dm table: rework reference counting fix
Fix an error introduced in dm-table-rework-reference-counting.patch.
When there is failure after table initialization, we need to use
dm_table_destroy, not dm_table_put, to free the table.
dm_table_put may be used only after dm_table_get.
Cc: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Jonathan Brassow <jbrassow@redhat.com>
Reviewed-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm-ioctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 977f36612e83..f01096549a93 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c | |||
@@ -1064,7 +1064,7 @@ static int table_load(struct dm_ioctl *param, size_t param_size) | |||
1064 | 1064 | ||
1065 | r = populate_table(t, param, param_size); | 1065 | r = populate_table(t, param, param_size); |
1066 | if (r) { | 1066 | if (r) { |
1067 | dm_table_put(t); | 1067 | dm_table_destroy(t); |
1068 | goto out; | 1068 | goto out; |
1069 | } | 1069 | } |
1070 | 1070 | ||
@@ -1072,7 +1072,7 @@ static int table_load(struct dm_ioctl *param, size_t param_size) | |||
1072 | hc = dm_get_mdptr(md); | 1072 | hc = dm_get_mdptr(md); |
1073 | if (!hc || hc->md != md) { | 1073 | if (!hc || hc->md != md) { |
1074 | DMWARN("device has been removed from the dev hash table."); | 1074 | DMWARN("device has been removed from the dev hash table."); |
1075 | dm_table_put(t); | 1075 | dm_table_destroy(t); |
1076 | up_write(&_hash_lock); | 1076 | up_write(&_hash_lock); |
1077 | r = -ENXIO; | 1077 | r = -ENXIO; |
1078 | goto out; | 1078 | goto out; |