From c7d13d54ae9a98fa5ed732804264647d34b39e5b Mon Sep 17 00:00:00 2001 From: daemon1024 Date: Wed, 8 Feb 2023 00:16:44 +0530 Subject: [PATCH] enforcer(bpf): fix panic during cleanup Signed-off-by: daemon1024 --- KubeArmor/enforcer/bpflsm/enforcer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/KubeArmor/enforcer/bpflsm/enforcer.go b/KubeArmor/enforcer/bpflsm/enforcer.go index a1e2f68510..1a3e11a5dd 100644 --- a/KubeArmor/enforcer/bpflsm/enforcer.go +++ b/KubeArmor/enforcer/bpflsm/enforcer.go @@ -166,6 +166,9 @@ func (be *BPFEnforcer) DestroyBPFEnforcer() error { } for _, link := range be.Probes { + if link == nil { + continue + } if err := link.Close(); err != nil { be.Logger.Err(err.Error()) errBPFCleanUp = true