[01/17] common/cnxk: perform LF fini ops only when allocated
Checks
Commit Message
From: Anoob Joseph <anoobj@marvell.com>
If LFs are not attached, LF detach and free ops should not be attempted.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
drivers/common/cnxk/roc_cpt.c | 3 +++
1 file changed, 3 insertions(+)
@@ -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;