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

Log error reporting for failing _alloc_pv

Drop unneeded zeroing of zalloced memory region.
This commit is contained in:
Zdenek Kabelac 2012-02-13 10:51:52 +00:00
parent 820aa36192
commit bbf98c19a8
2 changed files with 7 additions and 13 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.92 -
====================================
Report allocation failure for allocation of PV structure.
Add clvmd init dependency on dlm service when running with new corosync.
Version 2.02.91 - 12th February 2012

View File

@ -1557,21 +1557,14 @@ bad:
static struct physical_volume *_alloc_pv(struct dm_pool *mem, struct device *dev)
{
struct physical_volume *pv = dm_pool_zalloc(mem, sizeof(*pv));
struct physical_volume *pv;
if (!pv)
return_NULL;
if (!(pv = dm_pool_zalloc(mem, sizeof(*pv)))) {
log_error("Failed to allocate pv structure.");
return NULL;
}
pv_set_fid(pv, NULL);
pv->pe_size = 0;
pv->pe_start = 0;
pv->pe_count = 0;
pv->pe_alloc_count = 0;
pv->pe_align = 0;
pv->pe_align_offset = 0;
pv->fmt = NULL;
pv->dev = dev;
pv->status = ALLOCATABLE_PV;
dm_list_init(&pv->tags);
@ -1621,7 +1614,7 @@ struct physical_volume *pv_create(const struct cmd_context *cmd,
unsigned mda_index;
if (!pv)
return NULL;
return_NULL;
if (id)
memcpy(&pv->id, id, sizeof(*id));