All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Ratheesh Kannoth <rkannoth@marvell.com>
Cc: netdev@vger.kernel.org
Subject: [bug report] octeontx2-af: npc: cn20k: virtual index support
Date: Fri, 10 Apr 2026 13:12:52 +0300	[thread overview]
Message-ID: <adjNJEpILRZATB2N@stanley.mountain> (raw)

Hello Ratheesh Kannoth,

Commit 645c6e3c1999 ("octeontx2-af: npc: cn20k: virtual index
support") from Feb 24, 2026 (linux-next), leads to the following
Smatch static checker warning:

	drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c:3534 npc_defrag_alloc_free_slots()
	warn: missing error code 'rc'

drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c
    3479 static int npc_defrag_alloc_free_slots(struct rvu *rvu,
    3480                                        struct npc_defrag_node *f,
    3481                                        int cnt, u16 *save)
    3482 {
    3483         int alloc_cnt1, alloc_cnt2;
    3484         struct npc_subbank *sb;
    3485         int rc, sb_off, i;
    3486         bool deleted;
    3487 
    3488         sb = &npc_priv.sb[f->idx];
    3489 
    3490         alloc_cnt1 = 0;
    3491         alloc_cnt2 = 0;
    3492 
    3493         rc = __npc_subbank_alloc(rvu, sb,
    3494                                  NPC_MCAM_KEY_X2, sb->b0b,
    3495                                  sb->b0t,
    3496                                  NPC_MCAM_LOWER_PRIO,
    3497                                  false, cnt, save, cnt, true,
    3498                                  &alloc_cnt1);
    3499         if (alloc_cnt1 < cnt) {
    3500                 rc = __npc_subbank_alloc(rvu, sb,
    3501                                          NPC_MCAM_KEY_X2, sb->b1b,
    3502                                          sb->b1t,
    3503                                          NPC_MCAM_LOWER_PRIO,
    3504                                          false, cnt - alloc_cnt1,
    3505                                          save + alloc_cnt1,
    3506                                          cnt - alloc_cnt1,
    3507                                          true, &alloc_cnt2);
    3508         }
    3509 
    3510         if (alloc_cnt1 + alloc_cnt2 != cnt) {
    3511                 dev_err(rvu->dev,
    3512                         "%s: Failed to alloc cnt=%u alloc_cnt1=%u alloc_cnt2=%u\n",
    3513                         __func__, cnt, alloc_cnt1, alloc_cnt2);
    3514                 goto fail_free_alloc;
    3515         }
    3516         return 0;
    3517 
    3518 fail_free_alloc:
    3519         for (i = 0; i < alloc_cnt1 + alloc_cnt2; i++) {
    3520                 rc =  npc_mcam_idx_2_subbank_idx(rvu, save[i],
    3521                                                  &sb, &sb_off);
    3522                 if (rc) {
    3523                         dev_err(rvu->dev,
    3524                                 "%s: Error to find subbank for mcam idx=%u\n",
    3525                                 __func__, save[i]);
    3526                         break;
    3527                 }
    3528 
    3529                 deleted = __npc_subbank_free(rvu, sb, sb_off);
    3530                 if (!deleted) {
    3531                         dev_err(rvu->dev,
    3532                                 "%s: Error to free mcam idx=%u\n",
    3533                                 __func__, save[i]);
--> 3534                         break;

Set an error code here?

    3535                 }
    3536         }
    3537 
    3538         return rc;
    3539 }

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter

                 reply	other threads:[~2026-04-10 10:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=adjNJEpILRZATB2N@stanley.mountain \
    --to=error27@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=rkannoth@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.