RE: [PATCH] qed: fix memory leak of pent on error exit paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +err:
> +       qed_spq_return_entry(p_hwfn, *pp_ent);
> +       *pp_ent = NULL;
> +
> +       return rc;

Hi Colin,

This leak is a known issue and can be found in several locations in the code. We are working on fixing it globally and it is currently being tested.
Thank you for your fix but we would rather prepare a fix that would also cover the other leaks in the code.

To comment on your fix, qed_spq_return_entry() may not be the API needed to prevent the leak. If you look at qed_spq_get_entry(), you’ll see that an entry can be taken from the free_pool but also can be kzalloc’ed.
The proper solution would be the solution below, but like I said, we are working on a complete patch that will be submitted soon.

+     if (p_ent->queue == &p_hwfn->p_spq->unlimited_pending
+                    kfree(p_ent);
+     else
+                    qed_spq_return_entry(p_hwfn, *pp_ent);

Thanks,
Denis




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux