diff options
author | Ratheesh Kannoth <rkannoth@marvell.com> | 2022-07-14 07:28:43 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-07-15 14:01:43 +0300 |
commit | da92e03c7fbf4dc6e1a4a030433c8c30946e6aa0 (patch) | |
tree | 03fc72da0dc57463ecbbbdd0dd930a83d2d7c858 /drivers/net/ethernet/marvell/octeontx2/nic | |
parent | 4bbaf764e1e1786eb937fdb62172f656f512e116 (diff) | |
download | linux-da92e03c7fbf4dc6e1a4a030433c8c30946e6aa0.tar.xz |
octeontx2-af: Fixes static warnings
Fixes smatch static tool warning reported by smatch tool.
rvu_npc_hash.c:1232 rvu_npc_exact_del_table_entry_by_id() error:
uninitialized symbol 'drop_mcam_idx'.
rvu_npc_hash.c:1312 rvu_npc_exact_add_table_entry() error:
uninitialized symbol 'drop_mcam_idx'.
rvu_npc_hash.c:1391 rvu_npc_exact_update_table_entry() error:
uninitialized symbol 'hash_index'.
rvu_npc_hash.c:1428 rvu_npc_exact_promisc_disable() error:
uninitialized symbol 'drop_mcam_idx'.
rvu_npc_hash.c:1473 rvu_npc_exact_promisc_enable() error:
uninitialized symbol 'drop_mcam_idx'.
otx2_dmac_flt.c:191 otx2_dmacflt_update() error: 'rsp'
dereferencing possible ERR_PTR()
otx2_dmac_flt.c:60 otx2_dmacflt_add_pfmac() error: 'rsp'
dereferencing possible ERR_PTR()
Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell/octeontx2/nic')
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c index 846a0294a215..80d853b343f9 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c @@ -54,12 +54,19 @@ static int otx2_dmacflt_add_pfmac(struct otx2_nic *pf, u32 *dmac_index) ether_addr_copy(req->mac_addr, pf->netdev->dev_addr); err = otx2_sync_mbox_msg(&pf->mbox); - if (!err) { - rsp = (struct cgx_mac_addr_set_or_get *) - otx2_mbox_get_rsp(&pf->mbox.mbox, 0, &req->hdr); - *dmac_index = rsp->index; + if (err) + goto out; + + rsp = (struct cgx_mac_addr_set_or_get *) + otx2_mbox_get_rsp(&pf->mbox.mbox, 0, &req->hdr); + + if (IS_ERR_OR_NULL(rsp)) { + err = -EINVAL; + goto out; } + *dmac_index = rsp->index; +out: mutex_unlock(&pf->mbox.lock); return err; } @@ -154,6 +161,12 @@ int otx2_dmacflt_get_max_cnt(struct otx2_nic *pf) rsp = (struct cgx_max_dmac_entries_get_rsp *) otx2_mbox_get_rsp(&pf->mbox.mbox, 0, &msg->hdr); + + if (IS_ERR_OR_NULL(rsp)) { + err = -EINVAL; + goto out; + } + pf->flow_cfg->dmacflt_max_flows = rsp->max_dmac_filters; out: |