diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 789280785b..8f73d3b570 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -190,6 +190,8 @@ nwfilterStateInitialize(bool privileged, if (!privileged) return 0; + nwfilterDriverLock(driverState); + if (virNWFilterIPAddrMapInit() < 0) goto err_free_driverstate; if (virNWFilterLearnInit() < 0) @@ -202,8 +204,6 @@ nwfilterStateInitialize(bool privileged, if (virNWFilterConfLayerInit(virNWFilterDomainFWUpdateCB) < 0) goto err_techdrivers_shutdown; - nwfilterDriverLock(driverState); - /* * startup the DBus late so we don't get a reload signal while * initializing @@ -315,16 +315,10 @@ nwfilterStateReload(void) { bool virNWFilterDriverIsWatchingFirewallD(void) { - bool ret; - if (!driverState) return false; - nwfilterDriverLock(driverState); - ret = driverState->watchingFirewallD; - nwfilterDriverUnlock(driverState); - - return ret; + return driverState->watchingFirewallD; } /**