From 06b470d79b8ae0cff89577e46cdbfdadc52cf3a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B3=D0=BE=D1=80=20=D0=9C=D0=B0=D0=BA=D1=80=D1=83?= =?UTF-8?q?=D1=88=D0=B8=D0=BD?= Date: Mon, 14 Oct 2024 16:50:42 +0300 Subject: [PATCH] Unlock mutex before returning from function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mapMutex is initialized in the ContainerRm function and cannot be released from outside, thus unlock mutex before returning from function. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Егор Макрушин --- pkg/domain/infra/abi/containers.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index b6a7baa04d..0a0dbe3357 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -467,6 +467,7 @@ func (ic *ContainerEngine) ContainerRm(ctx context.Context, namesOrIds []string, errMap, err := parallelctr.ContainerOp(ctx, libpodContainers, func(c *libpod.Container) error { mapMutex.Lock() if _, ok := ctrsMap[c.ID()]; ok { + mapMutex.Unlock() return nil } mapMutex.Unlock()