diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 17a9e57117..27f2c9469e 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -188,6 +188,8 @@ nwfilterDriverStartup(int privileged) if (!privileged) return 0; + nwfilterDriverLock(driverState); + if (virNWFilterIPAddrMapInit() < 0) goto err_free_driverstate; if (virNWFilterLearnInit() < 0) @@ -200,8 +202,6 @@ nwfilterDriverStartup(int 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 @@ -334,16 +334,10 @@ nwfilterDriverActive(void) { bool virNWFilterDriverIsWatchingFirewallD(void) { - bool ret; - if (!driverState) return false; - nwfilterDriverLock(driverState); - ret = driverState->watchingFirewallD; - nwfilterDriverUnlock(driverState); - - return ret; + return driverState->watchingFirewallD; } /**