From 769dca1377ecbac623d78ca86a7e3c80b2d4d4f1 Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Wed, 13 Mar 2019 22:34:11 +0800
Subject: [PATCH 17/19] dmeventd: unlock lvm2 lock on error path

New code missed to unlock locked lvm2 on error path when
command is not configured.
---
 daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c b/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c
index 5be11f1..be58aac 100644
--- a/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c
+++ b/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c
@@ -159,6 +159,7 @@ int dmeventd_lvm2_command(struct dm_pool *mem, char *buffer, size_t size,
 			dmeventd_lvm2_lock();
 			if (!dmeventd_lvm2_run(cmd) ||
 			    !(env = getenv(cmd))) {
+				dmeventd_lvm2_unlock();
 				log_error("Unable to find configured command.");
 				return 0;
 			}
-- 
2.19.1

