Bug-780: potential lock release being missed if error code path happens in SimpleBroa...
[controller.git] / opendaylight / samples / simpleforwarding / src / main / java / org / opendaylight / controller / samples / simpleforwarding / internal / SimpleBroadcastHandlerImpl.java
index e39ae65..96e36f4 100644 (file)
@@ -93,6 +93,7 @@ public class SimpleBroadcastHandlerImpl implements IBroadcastHandler, IListenDat
         lock.readLock().lock();
         if (topoManager == null || dataPacketService == null
             || swMgr == null) {
         lock.readLock().lock();
         if (topoManager == null || dataPacketService == null
             || swMgr == null) {
+            lock.readLock().unlock();
             return false;
         }
 
             return false;
         }
 
@@ -124,6 +125,7 @@ public class SimpleBroadcastHandlerImpl implements IBroadcastHandler, IListenDat
                     log.error("Mode set to "
                               + BroadcastMode.EXTERNAL_QUERY
                               + ", but no external source of broadcast ports was provided.");
                     log.error("Mode set to "
                               + BroadcastMode.EXTERNAL_QUERY
                               + ", but no external source of broadcast ports was provided.");
+                    lock.readLock().unlock();
                     return false;
                 }
                 break;
                     return false;
                 }
                 break;