1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-11 20:58:50 +03:00

Reset vg pointer after release

Set vg to NULL after releasing it as the following memlock() test may
lead to goto for the second call of vg_release() with the already
released vg pointer.
This commit is contained in:
Zdenek Kabelac 2010-11-29 11:08:14 +00:00
parent 1b88184104
commit 201222ebad
2 changed files with 2 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.78 - Version 2.02.78 -
==================================== ====================================
Fix missing reset of vg pointer after vg_release() in _vg_read_by_vgid().
Fix test for empty system_dir string in _init_backup(). Fix test for empty system_dir string in _init_backup().
Certain lvconvert invocations are now required to be done in two steps. Certain lvconvert invocations are now required to be done in two steps.
Fix missing context desctruction in err path of lvm1 fallback in lvm2_main(). Fix missing context desctruction in err path of lvm1 fallback in lvm2_main().

View File

@ -3117,6 +3117,7 @@ static struct volume_group *_vg_read_by_vgid(struct cmd_context *cmd,
return vg; return vg;
} }
vg_release(vg); vg_release(vg);
vg = NULL; /* reset so memlock goto out is safe */
} }
/* Mustn't scan if memory locked: ensure cache gets pre-populated! */ /* Mustn't scan if memory locked: ensure cache gets pre-populated! */