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

2014-02-25 Thread Alan Cox
On Mon, 2014-02-24 at 16:54 -0800, Greg Kroah-Hartman wrote: > On Sat, Feb 22, 2014 at 12:33:36PM +0800, Zhao, Gang wrote: > > On Fri, 2014-02-21 at 20:35:50 +0800, Dan Carpenter wrote: > > > On Fri, Feb 21, 2014 at 08:22:21PM +0800, Zhao, Gang wrote: > > >> > If we add your patch and the reviewer

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

2014-02-25 Thread Dan Carpenter
On Tue, Feb 25, 2014 at 02:45:53PM +, Alan Cox wrote: > On Mon, 2014-02-24 at 16:54 -0800, Greg Kroah-Hartman wrote: > > On Sat, Feb 22, 2014 at 12:33:36PM +0800, Zhao, Gang wrote: > > > On Fri, 2014-02-21 at 20:35:50 +0800, Dan Carpenter wrote: > > > > On Fri, Feb 21, 2014 at 08:22:21PM +0800,

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

2014-02-24 Thread Greg Kroah-Hartman
On Sat, Feb 22, 2014 at 12:33:36PM +0800, Zhao, Gang wrote: > On Fri, 2014-02-21 at 20:35:50 +0800, Dan Carpenter wrote: > > On Fri, Feb 21, 2014 at 08:22:21PM +0800, Zhao, Gang wrote: > >> > If we add your patch and the reviewer does a search for fb[0] then it is > >> > confusing what the right th

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

2014-02-21 Thread Zhao, Gang
On Fri, 2014-02-21 at 20:35:50 +0800, Dan Carpenter wrote: > On Fri, Feb 21, 2014 at 08:22:21PM +0800, Zhao, Gang wrote: >> > 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. >> >> My fault. I should remove that two lines of cod

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

2014-02-21 Thread Dan Carpenter
On Fri, Feb 21, 2014 at 08:22:21PM +0800, Zhao, Gang wrote: > > 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. > > My fault. I should remove that two lines of code in > et131x_rx_dma_memory_free(), although they don't break the

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

2014-02-21 Thread Dan Carpenter
Come on... :/ Don't randomly add a pointless kfree() to one error path when there are four later error paths in this function that don't have a kfree(). It just makes the code more difficult to understand for no reason. And we're not going to add a comment to every single error path either. re

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

2014-02-21 Thread Zhao, Gang
On Fri, 2014-02-21 at 15:38:56 +0800, Dan Carpenter wrote: > 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

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

2014-02-20 Thread Dan Carpenter
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 revi