Re: [PATCH] infiniband: hfi1: fix memory leaks

2019-08-20 Thread Doug Ledford
On Sun, 2019-08-18 at 13:54 -0500, Wenwen Wang wrote: > In fault_opcodes_write(), 'data' is allocated through kcalloc(). > However, > it is not deallocated in the following execution if an error occurs, > leading to memory leaks. To fix this issue, introduce the 'free_data' > label > to free 'data'

Re: [PATCH] infiniband: hfi1: fix memory leaks

2019-08-19 Thread Dennis Dalessandro
On 8/18/2019 2:54 PM, Wenwen Wang wrote: In fault_opcodes_write(), 'data' is allocated through kcalloc(). However, it is not deallocated in the following execution if an error occurs, leading to memory leaks. To fix this issue, introduce the 'free_data' label to free 'data' before returning the e

Re: [PATCH] infiniband: hfi1: fix memory leaks

2019-08-19 Thread Leon Romanovsky
On Sun, Aug 18, 2019 at 01:54:46PM -0500, Wenwen Wang wrote: > In fault_opcodes_write(), 'data' is allocated through kcalloc(). However, > it is not deallocated in the following execution if an error occurs, > leading to memory leaks. To fix this issue, introduce the 'free_data' label > to free 'da

[PATCH] infiniband: hfi1: fix memory leaks

2019-08-18 Thread Wenwen Wang
In fault_opcodes_write(), 'data' is allocated through kcalloc(). However, it is not deallocated in the following execution if an error occurs, leading to memory leaks. To fix this issue, introduce the 'free_data' label to free 'data' before returning the error. Signed-off-by: Wenwen Wang --- dri