1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

raid: fix error path for lv_raid_data_offset

Avoid using allocated status on error path.
This commit is contained in:
Zdenek Kabelac 2018-03-02 15:49:12 +01:00
parent 9be086fbee
commit ce199db848
2 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.178 -
=====================================
Fix memleak on error path when obtaining lv_raid_data_offset.
Fix compatibility size test of extended external origin.
Add external_origin visiting in for_each_sub_lv().
Ensure cluster commands drop their device cache before locking VG.

View File

@ -1006,8 +1006,10 @@ int lv_raid_data_offset(const struct logical_volume *lv, uint64_t *data_offset)
if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
return_0;
if (!(r = dev_manager_raid_status(dm, lv, &status)))
stack;
if (!(r = dev_manager_raid_status(dm, lv, &status))) {
dev_manager_destroy(dm);
return_0;
}
*data_offset = status->data_offset;