From: Anoob Joseph <ano...@marvell.com>

If LFs are not attached, LF detach and free ops should not be attempted.

Signed-off-by: Anoob Joseph <ano...@marvell.com>
---
 drivers/common/cnxk/roc_cpt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/common/cnxk/roc_cpt.c b/drivers/common/cnxk/roc_cpt.c
index fb97ec89b2..bf216b5545 100644
--- a/drivers/common/cnxk/roc_cpt.c
+++ b/drivers/common/cnxk/roc_cpt.c
@@ -861,6 +861,9 @@ roc_cpt_dev_clear(struct roc_cpt *roc_cpt)
        if (cpt == NULL)
                return;
 
+       if (roc_cpt->nb_lf == 0)
+               return;
+
        for (i = 0; i < roc_cpt->nb_lf; i++)
                cpt->lf_msix_off[i] = 0;
 
-- 
2.25.1

Reply via email to