Sure, also dpdk ai review higlightet potential problems in memory
management

For example:

enic->cq = rte_zmalloc("enic_vnic_cq", sizeof(struct vnic_cq) *
                               enic->conf_cq_count, 8);
enic->intr = rte_zmalloc("enic_vnic_intr", sizeof(struct vnic_intr) *
                        enic->conf_intr_count, 8);
enic->rq = rte_zmalloc("enic_vnic_rq", sizeof(struct vnic_rq) *
                        enic->conf_rq_count, 8);
enic->wq = rte_zmalloc("enic_vnic_wq", sizeof(struct vnic_wq) *
                        enic->conf_wq_count, 8);

if (enic->conf_cq_count > 0 && enic->cq == NULL) {
        dev_err(enic, "failed to allocate vnic_cq, aborting.\n");
        return -1;
}
if (enic->conf_intr_count > 0 && enic->intr == NULL) {
        dev_err(enic, "failed to allocate vnic_intr, aborting.\n");
        return -1;
}

Lets imagine that enic->cq is allocated successfully, after that
when we trying to allocate enic->intr we are failing, so in this
case we leaking in second if statement, this related to all error
handling paths in driver, since as far as I understand resource
free happening only in enic_dev_deinit(...) function.

So my question is it problem? If yes, should I address this issue
in scope of my patch or better to make it in another?

Reply via email to