[PATCH] staging: et131x: let the freeing of memory more reasonable in error path

Dan Carpenter dan.carpenter at oracle.com
Fri Feb 21 07:38:56 UTC 2014


I don't think this is the right thing because it is needless code.
Overall it doesn't really simplify anything.

You are worried that reviewers will be confused and think there is a
leak in et131x_rx_dma_memory_alloc() and then add a kfree() which breaks
the code.  I think you are right that a reviewer would initially wonder
why the code does not call kfree() but then you do a search for fb[0]
and it becomes obvious.

If we add your patch and the reviewer does a search for fb[0] then it is
confusing what the right thing to do is.

These kinds of "free later" code, are not the most common way to do
things in the kernel but they are used other places as well.

regards,
dan carpenter



More information about the devel mailing list