Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/virchrdev.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c
index 0184a1ae10..1cf727d46e 100644
--- a/src/conf/virchrdev.c
+++ b/src/conf/virchrdev.c
@@ -291,10 +291,10 @@ void virChrdevFree(virChrdevs *devs)
if (!devs)
return;
- virMutexLock(&devs->lock);
- virHashForEachSafe(devs->hash, virChrdevFreeClearCallbacks, NULL);
- virHashFree(devs->hash);
- virMutexUnlock(&devs->lock);
+ VIR_WITH_MUTEX_LOCK_GUARD(&devs->lock) {
+ virHashForEachSafe(devs->hash, virChrdevFreeClearCallbacks, NULL);
+ virHashFree(devs->hash);
+ }
virMutexDestroy(&devs->lock);
g_free(devs);
--
2.31.1