1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-06 10:00:40 +03:00

Revert free of allocated segtype

lvm_register_segtype takes ownership of segtype and call destructor
for it in error path.
This commit is contained in:
Zdenek Kabelac 2012-02-28 14:23:41 +00:00
parent 9e23089757
commit 54b2aadf40
4 changed files with 9 additions and 12 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.94 -
====================================
Revert free of allocated segtype in init segment error path (2.02.89).
Test dm_hash_insert() failures in filter-persistent.c and fid_add_mda().
Ensure clvmd message is always \0 terminated after read.
Better detection of missing dmeventd fifo connection (2.02.93).

View File

@ -456,10 +456,9 @@ int init_multiple_segtypes(struct cmd_context *cmd, struct segtype_library *segl
do {
if ((segtype = raid_segtype_fn[i](cmd)) &&
!lvm_register_segtype(seglib, segtype)) {
dm_free(segtype);
!lvm_register_segtype(seglib, segtype))
/* segtype is already destroyed */
return_0;
}
} while (raid_segtype_fn[++i]);
return 1;

View File

@ -772,10 +772,9 @@ int init_multiple_segtype(struct cmd_context *cmd, struct segtype_library *segli
segtype->private = NULL;
segtype->flags = SEG_REPLICATOR;
if (!lvm_register_segtype(seglib, segtype)) {
dm_free(segtype);
if (!lvm_register_segtype(seglib, segtype))
/* segtype is already destroyed */
return_0;
}
log_very_verbose("Initialised segtype: " REPLICATOR_MODULE);
@ -787,10 +786,9 @@ int init_multiple_segtype(struct cmd_context *cmd, struct segtype_library *segli
segtype->private = NULL;
segtype->flags = SEG_REPLICATOR_DEV;
if (!lvm_register_segtype(seglib, segtype)) {
dm_free(segtype);
if (!lvm_register_segtype(seglib, segtype))
/* segtype is already destroyed */
return_0;
}
log_very_verbose("Initialised segtype: " REPLICATOR_DEV_MODULE);

View File

@ -607,10 +607,9 @@ int init_multiple_segtypes(struct cmd_context *cmd, struct segtype_library *segl
segtype->flags |= SEG_MONITORED;
# endif /* DMEVENTD */
#endif
if (!lvm_register_segtype(seglib, segtype)) {
dm_free(segtype);
if (!lvm_register_segtype(seglib, segtype))
/* segtype is already destroyed */
return_0;
}
log_very_verbose("Initialised segtype: %s", segtype->name);
}