[lvm-devel] dev-mornfall-activate - config: check for hash success

Petr Rockai mornfall at fedoraproject.org
Tue Jun 4 19:24:15 UTC 2013


Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ba3cee36300d56efcdcb0af883141b1b0a6129a1
Commit:        ba3cee36300d56efcdcb0af883141b1b0a6129a1
Parent:        5070ffbca7b16e4139b3da72bdff0c9add517351
Author:        Zdenek Kabelac <zkabelac at redhat.com>
AuthorDate:    Sun Apr 21 13:12:58 2013 +0200
Committer:     Zdenek Kabelac <zkabelac at redhat.com>
CommitterDate: Sun Apr 21 22:56:59 2013 +0200

config: check for hash success

Hash insert may fail.
---
 lib/config/config.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/lib/config/config.c b/lib/config/config.c
index 2c77f30..d1cf590 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -577,7 +577,11 @@ int config_def_check(struct cmd_context *cmd, int force, int skip, int suppress_
 				cmd->cft_def_hash = NULL;
 				r = 0; goto out;
 			}
-			dm_hash_insert(cmd->cft_def_hash, vp, def);
+			if (!dm_hash_insert(cmd->cft_def_hash, vp, def)) {
+				log_error("Failed to insert configuration to hash.");
+				r = 0;
+				goto out;
+			}
 		}
 	}
 




More information about the lvm-devel mailing list