From: Dan Carpenter <dan.carpenter@oracle.com>
To: rkannoth@marvell.com
Cc: kernel-janitors@vger.kernel.org
Subject: [bug report] octeontx2-af: Drop rules for NPC MCAM
Date: Wed, 13 Jul 2022 14:32:11 +0300 [thread overview]
Message-ID: <Ys6tO+/RAH7WEDH7@kili> (raw)
Hello Ratheesh Kannoth,
The patch 3571fe07a090: "octeontx2-af: Drop rules for NPC MCAM" from
Jul 8, 2022, leads to the following Smatch static checker warning:
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c:1964 rvu_npc_exact_init()
error: uninitialized symbol 'err'.
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c
1953
1954 dev_dbg(rvu->dev,
1955 "%s:Drop rule cgx=%d lmac=%d chan(val=0x%llx, mask=0x%llx\n",
1956 __func__, cgx_id, lmac_id, chan_val, chan_mask);
1957
1958 rc = rvu_npc_exact_save_drop_rule_chan_and_mask(rvu, table->num_drop_rules,
1959 chan_val, chan_mask, pcifunc);
1960 if (!rc) {
1961 dev_err(rvu->dev,
1962 "%s: failed to set drop info for cgx=%d, lmac=%d, chan=%llx\n",
1963 __func__, cgx_id, lmac_id, chan_val);
--> 1964 return err;
"err" is uninitialized. This should be return -EINVAL or something.
Let me just send the whole list. The rest are mostly caused by no
error checking. It's possibly deliberate. Hard to tell without knowing
the subsystem more deeply.
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c:1232 rvu_npc_exact_del_table_entry_by_id() error: uninitialized symbol 'drop_mcam_idx'.
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c:1312 rvu_npc_exact_add_table_entry() error: uninitialized symbol 'drop_mcam_idx'.
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c:1391 rvu_npc_exact_update_table_entry() error: uninitialized symbol 'hash_index'.
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c:1428 rvu_npc_exact_promisc_disable() error: uninitialized symbol 'drop_mcam_idx'.
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c:1473 rvu_npc_exact_promisc_enable() error: uninitialized symbol 'drop_mcam_idx'.
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c:1964 rvu_npc_exact_init() error: uninitialized symbol 'err'.
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h:735 otx2_mbox_alloc_msg_npc_get_secret_key() warn: struct type mismatch 'mbox_msghdr vs npc_get_secret_key_req'
drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c:191 otx2_dmacflt_update() error: 'rsp' dereferencing possible ERR_PTR()
drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c:60 otx2_dmacflt_add_pfmac() error: 'rsp' dereferencing possible ERR_PTR()
1965 }
1966
1967 err = npc_install_mcam_drop_rule(rvu, *drop_mcam_idx,
1968 &table->counter_idx[*drop_mcam_idx],
1969 chan_val, chan_mask,
1970 exact_val, exact_mask,
1971 bcast_mcast_val, bcast_mcast_mask);
1972 if (err) {
1973 dev_err(rvu->dev,
1974 "failed to configure drop rule (cgx=%d lmac=%d)\n",
1975 cgx_id, lmac_id);
1976 return err;
1977 }
1978
1979 (*drop_mcam_idx)++;
1980 }
1981
1982 dev_info(rvu->dev, "initialized exact match table successfully\n");
1983 return 0;
1984 }
regards,
dan carpenter
next reply other threads:[~2022-07-13 11:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-13 11:32 Dan Carpenter [this message]
2022-07-14 3:25 ` [EXT] [bug report] octeontx2-af: Drop rules for NPC MCAM Ratheesh Kannoth
2022-07-14 9:55 ` Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2024-10-07 6:26 Dan Carpenter
2022-07-13 11:27 Dan Carpenter
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=Ys6tO+/RAH7WEDH7@kili \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@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.