@@ -1660,11 +1660,9 @@ int cudbg_collect_tid(struct cudbg_init *pdbg_init,
para[0] = FW_PARAM_PFVF_A(ETHOFLD_START);
para[1] = FW_PARAM_PFVF_A(ETHOFLD_END);
rc = t4_query_params(padap, padap->mbox, padap->pf, 0, 2, para, val);
- if (rc < 0) {
- cudbg_err->sys_err = rc;
- cudbg_put_buff(pdbg_init, &temp_buff);
- return rc;
- }
+ if (rc < 0)
+ goto put_buffer;
+
tid->uotid_base = val[0];
tid->nuotids = val[1] - val[0] + 1;
@@ -1679,11 +1677,9 @@ int cudbg_collect_tid(struct cudbg_init *pdbg_init,
para[1] = FW_PARAM_PFVF_A(HPFILTER_END);
rc = t4_query_params(padap, padap->mbox, padap->pf, 0, 2,
para, val);
- if (rc < 0) {
- cudbg_err->sys_err = rc;
- cudbg_put_buff(pdbg_init, &temp_buff);
- return rc;
- }
+ if (rc < 0)
+ goto put_buffer;
+
tid->hpftid_base = val[0];
tid->nhpftids = val[1] - val[0] + 1;
}
@@ -1711,6 +1707,11 @@ int cudbg_collect_tid(struct cudbg_init *pdbg_init,
tid->ipv6_users = t4_read_reg(padap, LE_DB_ACT_CNT_IPV6_A);
return cudbg_write_and_release_buff(pdbg_init, &temp_buff, dbg_buff);
+
+put_buffer:
+ cudbg_put_buff(pdbg_init, &temp_buff);
+ cudbg_err->sys_err = rc;
+ return rc;
}
int cudbg_collect_pcie_config(struct cudbg_init *pdbg_init,