[v2,07/10] common/cnxk: fix uninitialized variable issues
Checks
Commit Message
Fix uninitialized variable issues reported by
klockwork(static analysis tool).
Fixes: ed135040f0ab ("common/cnxk: add CPT LF configuration")
Fixes: 585bb3e538f9 ("common/cnxk: add VF support to base device class")
Fixes: 58debb813a8d ("common/cnxk: enable TM to listen on Rx pause frames")
Cc: stable@dpdk.org
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
drivers/common/cnxk/roc_cpt.c | 4 ++--
drivers/common/cnxk/roc_dev.c | 2 +-
drivers/common/cnxk/roc_nix_tm.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
@@ -815,9 +815,9 @@ roc_cpt_eng_grp_add(struct roc_cpt *roc_cpt, enum cpt_eng_type eng_type)
void
roc_cpt_iq_disable(struct roc_cpt_lf *lf)
{
+ volatile union cpt_lf_q_grp_ptr grp_ptr = {.u = 0x0};
+ volatile union cpt_lf_inprog lf_inprog = {.u = 0x0};
union cpt_lf_ctl lf_ctl = {.u = 0x0};
- union cpt_lf_q_grp_ptr grp_ptr;
- union cpt_lf_inprog lf_inprog;
int timeout = 20;
int cnt;
@@ -57,7 +57,7 @@ pf_af_sync_msg(struct dev *dev, struct mbox_msghdr **rsp)
struct mbox *mbox = dev->mbox;
struct mbox_dev *mdev = &mbox->dev[0];
- volatile uint64_t int_status;
+ volatile uint64_t int_status = 0;
struct mbox_msghdr *msghdr;
uint64_t off;
int rc = 0;
@@ -424,7 +424,7 @@ nix_tm_bp_config_get(struct roc_nix *roc_nix, bool *is_enabled)
if (req) {
req->num_regs = k;
- rc = mbox_process(mbox);
+ rc = mbox_process_msg(mbox, (void **)&rsp);
if (rc)
goto err;
/* Report it as enabled only if enabled or all */