Coverity issue: 302872
Fixes:
3f2c1e209cfc ("net/cxgbe: add Compressed Local IP region")
Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
struct adapter *adap = ethdev2adap(dev);
struct clip_tbl *ctbl = adap->clipt;
struct clip_entry *ce;
- int ret;
+ int ret = 0;
if (!ctbl)
return NULL;
ce->type = FILTER_TYPE_IPV6;
rte_atomic32_set(&ce->refcnt, 1);
ret = clip6_get_mbox(dev, lip);
- if (ret) {
+ if (ret)
dev_debug(adap,
"CLIP FW ADD CMD failed: %d",
ret);
- ce = NULL;
- }
} else {
ce->type = FILTER_TYPE_IPV4;
}
}
t4_os_write_unlock(&ctbl->lock);
- return ce;
+ return ret ? NULL : ce;
}
/**