From: Oleksandr Kolomeiets <okl-...@napatech.com> pld_ptr points to mp_port_load's element, which is initialized during driver's probe, otherwise probe fails and xstats_get_by_id is not called.
Coverity issue: 448945 Fixes: cf6007eac498 ("net/ntnic: add xstats") Signed-off-by: Oleksandr Kolomeiets <okl-...@napatech.com> --- drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c b/drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c index 7604afe6a0..cf3271d5de 100644 --- a/drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c +++ b/drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c @@ -645,16 +645,8 @@ static int nthw_xstats_get_by_id(nt4ga_stat_t *p_nt4ga_stat, break; case 4: - /* Port Load stat */ - if (pld_ptr) { - /* No reset */ - values[i] = *((uint64_t *)&pld_ptr[names[i].offset]); - - } else { - values[i] = 0; - } - + values[i] = *((uint64_t *)&pld_ptr[names[i].offset]); break; default: -- 2.45.0