mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34: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:
parent
9e23089757
commit
54b2aadf40
@ -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).
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user