diff --git a/libnetwork/endpoint_cnt.go b/libnetwork/endpoint_cnt.go index 9cc62324dd..c63d06abe0 100644 --- a/libnetwork/endpoint_cnt.go +++ b/libnetwork/endpoint_cnt.go @@ -143,7 +143,9 @@ retry: if inc { ec.Count++ } else { - ec.Count-- + if ec.Count > 0 { + ec.Count-- + } } ec.Unlock()