Re: [PATCH] bestcomm: no need to free when kzalloc fail

2013-05-22 Thread Libo Chen
On 2013/5/22 14:06, Benjamin Herrenschmidt wrote: > On Wed, 2013-05-22 at 12:49 +0800, Libo Chen wrote: >> ping... > > This is pointless. We routinely avoid adding such crap by having > the various free(...) routines cope with NULL. You just need to make > sure you are indeed NULL in the error

Re: [PATCH] bestcomm: no need to free when kzalloc fail

2013-05-22 Thread Benjamin Herrenschmidt
On Wed, 2013-05-22 at 12:49 +0800, Libo Chen wrote: > ping... This is pointless. We routinely avoid adding such crap by having the various free(...) routines cope with NULL. You just need to make sure you are indeed NULL in the error case. Ben. > On 2013/5/5 16:38, chenlib...@gmail.com wrote: >

Re: [PATCH] bestcomm: no need to free when kzalloc fail

2013-05-22 Thread Libo Chen
On 2013/5/22 12:58, Li Zefan wrote: > On 2013/5/22 12:49, Libo Chen wrote: >> >> ping... >> >> On 2013/5/5 16:38, chenlib...@gmail.com wrote: >>> From: Libo Chen >>> >>> There is no need to free bcom_eng if kzalloc fail >>> > > kfree(NULL) is fine. We gain nothing from this patch, and it even

Re: [PATCH] bestcomm: no need to free when kzalloc fail

2013-05-22 Thread Libo Chen
On 2013/5/22 12:58, Li Zefan wrote: On 2013/5/22 12:49, Libo Chen wrote: ping... On 2013/5/5 16:38, chenlib...@gmail.com wrote: From: Libo Chen libo.c...@huawei.com There is no need to free bcom_eng if kzalloc fail kfree(NULL) is fine. We gain nothing from this patch, and it even adds

Re: [PATCH] bestcomm: no need to free when kzalloc fail

2013-05-22 Thread Benjamin Herrenschmidt
On Wed, 2013-05-22 at 12:49 +0800, Libo Chen wrote: ping... This is pointless. We routinely avoid adding such crap by having the various free(...) routines cope with NULL. You just need to make sure you are indeed NULL in the error case. Ben. On 2013/5/5 16:38, chenlib...@gmail.com wrote:

Re: [PATCH] bestcomm: no need to free when kzalloc fail

2013-05-22 Thread Libo Chen
On 2013/5/22 14:06, Benjamin Herrenschmidt wrote: On Wed, 2013-05-22 at 12:49 +0800, Libo Chen wrote: ping... This is pointless. We routinely avoid adding such crap by having the various free(...) routines cope with NULL. You just need to make sure you are indeed NULL in the error case.

Re: [PATCH] bestcomm: no need to free when kzalloc fail

2013-05-21 Thread Li Zefan
On 2013/5/22 12:49, Libo Chen wrote: > > ping... > > On 2013/5/5 16:38, chenlib...@gmail.com wrote: >> From: Libo Chen >> >> There is no need to free bcom_eng if kzalloc fail >> kfree(NULL) is fine. We gain nothing from this patch, and it even adds one more line to the code, so just drop thi

Re: [PATCH] bestcomm: no need to free when kzalloc fail

2013-05-21 Thread Libo Chen
ping... On 2013/5/5 16:38, chenlib...@gmail.com wrote: > From: Libo Chen > > There is no need to free bcom_eng if kzalloc fail > > Signed-off-by: Libo Chen > --- > drivers/dma/bestcomm/bestcomm.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git

Re: [PATCH] bestcomm: no need to free when kzalloc fail

2013-05-21 Thread Libo Chen
ping... On 2013/5/5 16:38, chenlib...@gmail.com wrote: From: Libo Chen libo.c...@huawei.com There is no need to free bcom_eng if kzalloc fail Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/dma/bestcomm/bestcomm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

Re: [PATCH] bestcomm: no need to free when kzalloc fail

2013-05-21 Thread Li Zefan
On 2013/5/22 12:49, Libo Chen wrote: ping... On 2013/5/5 16:38, chenlib...@gmail.com wrote: From: Libo Chen libo.c...@huawei.com There is no need to free bcom_eng if kzalloc fail kfree(NULL) is fine. We gain nothing from this patch, and it even adds one more line to the code, so just

[PATCH] bestcomm: no need to free when kzalloc fail

2013-05-05 Thread chenlibo . 3
From: Libo Chen There is no need to free bcom_eng if kzalloc fail Signed-off-by: Libo Chen --- drivers/dma/bestcomm/bestcomm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/dma/bestcomm/bestcomm.c b/drivers/dma/bestcomm/bestcomm.c index a8c2e29..300ee2d 100644

[PATCH] bestcomm: no need to free when kzalloc fail

2013-05-05 Thread chenlibo . 3
From: Libo Chen libo.c...@huawei.com There is no need to free bcom_eng if kzalloc fail Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/dma/bestcomm/bestcomm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/dma/bestcomm/bestcomm.c