Skip to contentSkip to conversation

master - activation: activation check is mandatory

PATCH Zdenek Kabelac 1 participant 1 message May 6, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1202713f94cb2b0f6f5160d49615f4b839a862a7
Commit:        1202713f94cb2b0f6f5160d49615f4b839a862a7
Parent:        2842a645fdb66ce1f90cad1fd206912eef365059
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri May 6 13:59:50 2016 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri May 6 16:48:16 2016 +0200

activation: activation check is mandatory

Make missing activation() check before calling target_persent an INTERNAL_ERROR.

---
 lib/activate/activate.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
lib/activate/activate.c +4 -3
index 712f86c..1ef83d3 100644
@@ -636,9 +636,10 @@ int target_present_version(struct cmd_context *cmd, const char *target_name,
 			   int use_modprobe,
 			   uint32_t *maj, uint32_t *min, uint32_t *patchlevel)
 {
-	if (!activation())
-		return_0;
-
+	if (!activation()) {
+		log_error(INTERNAL_ERROR "Target present version called when activation is disabled.");
+		return 0;
+	}
 #ifdef MODPROBE_CMD
 	if (use_modprobe) {
 		if (target_version(target_name, maj, min, patchlevel))