Skip to content

Commit

Permalink
Unlock mutex before returning from function
Browse files Browse the repository at this point in the history
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: Егор Макрушин <emakrushin@astralinux.ru>
  • Loading branch information
emakrushin committed Oct 14, 2024
1 parent 2aacd4e commit e407dc5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/domain/infra/abi/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit e407dc5

Please sign in to comment.