Skip to content

Commit

Permalink
fix: potential deadlock
Browse files Browse the repository at this point in the history
Fixes potential deadlock in containerd#123

Signed-off-by: Steven Kreitzer <skre@skre.me>
  • Loading branch information
buroa committed Dec 23, 2024
1 parent 642f1ce commit a94c4cc
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ func (c *libcni) Setup(ctx context.Context, id string, path string, opts ...Name
if err := c.ready(); err != nil {
return nil, err
}
c.RLock()
defer c.RUnlock()
ns, err := newNamespace(id, path, opts...)
if err != nil {
return nil, err
Expand All @@ -183,8 +181,6 @@ func (c *libcni) SetupSerially(ctx context.Context, id string, path string, opts
if err := c.ready(); err != nil {
return nil, err
}
c.RLock()
defer c.RUnlock()
ns, err := newNamespace(id, path, opts...)
if err != nil {
return nil, err
Expand Down Expand Up @@ -248,8 +244,6 @@ func (c *libcni) Remove(ctx context.Context, id string, path string, opts ...Nam
if err := c.ready(); err != nil {
return err
}
c.RLock()
defer c.RUnlock()
ns, err := newNamespace(id, path, opts...)
if err != nil {
return err
Expand Down Expand Up @@ -278,8 +272,6 @@ func (c *libcni) Check(ctx context.Context, id string, path string, opts ...Name
if err := c.ready(); err != nil {
return err
}
c.RLock()
defer c.RUnlock()
ns, err := newNamespace(id, path, opts...)
if err != nil {
return err
Expand Down

0 comments on commit a94c4cc

Please sign in to comment.