summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2011-09-24 21:19:30 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2011-09-24 21:19:30 +0000
commitf1ab501a58e84270de711e3cd0f70a60ab923e51 (patch)
tree962a33768cea1918cb68d126451a7dfd5900f3e1
parent102dd99ca4d82090e62af55ae3d4d5aaaa0c527e (diff)
downloadlvm2-f1ab501a58e84270de711e3cd0f70a60ab923e51.tar.gz
lvm2-f1ab501a58e84270de711e3cd0f70a60ab923e51.tar.xz
lvm2-f1ab501a58e84270de711e3cd0f70a60ab923e51.zip
Fix log_error() usage
Cosmetic - skip <bactrace> when error has been just printed in raid segtype. Add missing log_error if allocation would fail for unknown segtype.
-rw-r--r--WHATS_NEW1
-rw-r--r--lib/raid/raid.c2
-rw-r--r--lib/unknown/unknown.c6
3 files changed, 6 insertions, 3 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 8dba1ffa..7bdaaf26 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.89 -
==================================
+ Fix log_error() usage in raid and unknown segtype initialisation.
Improve testing Makefile.
Fix install_ocf make target when srcdir != builddir. (2.02.80)
Support env vars LVM_CLVMD_BINARY and LVM_BINARY in clvmd.
diff --git a/lib/raid/raid.c b/lib/raid/raid.c
index 8bc33440..c3fc4b13 100644
--- a/lib/raid/raid.c
+++ b/lib/raid/raid.c
@@ -338,7 +338,7 @@ static struct segment_type *_init_raid_segtype(struct cmd_context *cmd,
if (!segtype) {
log_error("Failed to allocate memory for %s segtype",
raid_type);
- return_NULL;
+ return NULL;
}
segtype->cmd = cmd;
diff --git a/lib/unknown/unknown.c b/lib/unknown/unknown.c
index de449bfe..8f5c8096 100644
--- a/lib/unknown/unknown.c
+++ b/lib/unknown/unknown.c
@@ -94,8 +94,10 @@ struct segment_type *init_unknown_segtype(struct cmd_context *cmd, const char *n
{
struct segment_type *segtype = dm_zalloc(sizeof(*segtype));
- if (!segtype)
- return_NULL;
+ if (!segtype) {
+ log_error("Failed to allocate memory for unknown segtype");
+ return NULL;
+ }
segtype->cmd = cmd;
segtype->ops = &_unknown_ops;