[PATCH 1/1] NVMe : Corrected memory freeing.

2015-06-17 Thread Dheepthi K
Memory freeing order has been corrected incase of allocation failure. Signed-off-by: Dheepthi K --- drivers/block/nvme-core.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index 683dff2..9bac53b 100644 ---

Re: [PATCH 1/1] NVMe : Corrected memory freeing.

2015-06-17 Thread Matthew Wilcox
On Wed, Jun 17, 2015 at 09:40:59PM +0530, Dheepthi K wrote: > Memory freeing order has been corrected incase of > allocation failure. This doesn't fix a bug. kfree(NULL) is a no-op, and 'dev' is allocated with kzalloc, so the current error path will call kfree(NULL). > @@ -2947,11 +2947,11 @@

Re: [PATCH 1/1] NVMe : Corrected memory freeing.

2015-06-17 Thread Keith Busch
On Wed, 17 Jun 2015, Dheepthi K wrote: Memory freeing order has been corrected incase of allocation failure. This isn't necessary. The nvme_dev is zero'ed on allocation, and kfree(NULL or (void *)0) is okay to do. Signed-off-by: Dheepthi K --- drivers/block/nvme-core.c |7 --- 1

Re: [PATCH 1/1] NVMe : Corrected memory freeing.

2015-06-17 Thread Keith Busch
On Wed, 17 Jun 2015, Dheepthi K wrote: Memory freeing order has been corrected incase of allocation failure. This isn't necessary. The nvme_dev is zero'ed on allocation, and kfree(NULL or (void *)0) is okay to do. Signed-off-by: Dheepthi K dheepth...@gracelabs.com ---

Re: [PATCH 1/1] NVMe : Corrected memory freeing.

2015-06-17 Thread Matthew Wilcox
On Wed, Jun 17, 2015 at 09:40:59PM +0530, Dheepthi K wrote: Memory freeing order has been corrected incase of allocation failure. This doesn't fix a bug. kfree(NULL) is a no-op, and 'dev' is allocated with kzalloc, so the current error path will call kfree(NULL). @@ -2947,11 +2947,11 @@

[PATCH 1/1] NVMe : Corrected memory freeing.

2015-06-17 Thread Dheepthi K
Memory freeing order has been corrected incase of allocation failure. Signed-off-by: Dheepthi K dheepth...@gracelabs.com --- drivers/block/nvme-core.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index