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
@@ -482,7 +482,8 @@ func (e *Endpoint) regenerateBPF(owner Owner, epdir, reason string) (uint64, err
 		// Regenerate policy and apply any options resulting in the
 		// policy change.
 		// This also populates e.PolicyMap
-		_, consumersToRm, err := e.regeneratePolicy(owner, nil)
+		var consumersToRm policy.RuleContexts
+		_, consumersToRm, err = e.regeneratePolicy(owner, nil)
 		if err != nil {
 			e.Mutex.Unlock()
 			err = fmt.Errorf("Unable to regenerate policy for '%s': %s",
pkg/endpoint: assign errors to err to detect failure on defer