diff --git a/pkg/endpoint/bpf.go b/pkg/endpoint/bpf.go
index <HASH>..<HASH> 100644
--- a/pkg/endpoint/bpf.go
+++ b/pkg/endpoint/bpf.go
@@ -75,7 +75,7 @@ func (e *Endpoint) writeHeaderfile(prefix string, owner Owner) error {
 		}
 	}
 	if err != nil {
-		e.LogStatus(BPF, Warning, fmt.Sprintf("Unable to create a base64: %s", err))
+		e.logStatusLocked(BPF, Warning, fmt.Sprintf("Unable to create a base64: %s", err))
 	}
 
 	if e.DockerID == "" {
pkg/endpoint: use logStatusLocked in writeHeaderfile

writeHeaderfile is called with the endpoint Mutex is held. LogStatus tries to
acquire the endpoint Mutex, and is called within writeHeaderfile. This is a
deadlock scenario. Fix by calling logStatusLocked instead, which assumes the
endpoint Mutex is held.

Fixes: #<I>