Re: [PATCH] IB/core: fix memory leak on ah on error return path

2017-08-16 Thread Doug Ledford
On Tue, 2017-08-08 at 19:48 +, Parav Pandit wrote: > Hi, > > I need to top post because comments are unrelated to past discussion. > > rdma_ah_retrieve_dmac() can never fail for RoCE as its returning > pointer from structure ah_attr. > Provider driver doesn't need to check for null pointer

Re: [PATCH] IB/core: fix memory leak on ah on error return path

2017-08-16 Thread Doug Ledford
On Tue, 2017-08-08 at 19:48 +, Parav Pandit wrote: > Hi, > > I need to top post because comments are unrelated to past discussion. > > rdma_ah_retrieve_dmac() can never fail for RoCE as its returning > pointer from structure ah_attr. > Provider driver doesn't need to check for null pointer

RE: [PATCH] IB/core: fix memory leak on ah on error return path

2017-08-08 Thread Parav Pandit
lt;ouli...@huawei.com>; Wei Hu <xavier.hu...@huawei.com>; > Doug Ledford <dledf...@redhat.com>; Sean Hefty <sean.he...@intel.com>; > Hal Rosenstock <hal.rosenst...@gmail.com>; linux-r...@vger.kernel.org; > kernel-janit...@vger.kernel.org; linux-kernel@vger.k

RE: [PATCH] IB/core: fix memory leak on ah on error return path

2017-08-08 Thread Parav Pandit
; Sean Hefty ; > Hal Rosenstock ; linux-r...@vger.kernel.org; > kernel-janit...@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH] IB/core: fix memory leak on ah on error return path > > On Tue, Aug 08, 2017 at 11:28:16AM +0100, Colin Ian King wrote: > > I was

Re: [PATCH] IB/core: fix memory leak on ah on error return path

2017-08-08 Thread Johannes Thumshirn
On Tue, Aug 08, 2017 at 11:28:16AM +0100, Colin Ian King wrote: > I was using the same subject start as the patch that introduced the > memory leak and touched the same portion of code. I can resend if necessary. I think having the hns prefix makes it clearer, as the patch doesn't touch IB core

Re: [PATCH] IB/core: fix memory leak on ah on error return path

2017-08-08 Thread Johannes Thumshirn
On Tue, Aug 08, 2017 at 11:28:16AM +0100, Colin Ian King wrote: > I was using the same subject start as the patch that introduced the > memory leak and touched the same portion of code. I can resend if necessary. I think having the hns prefix makes it clearer, as the patch doesn't touch IB core

Re: [PATCH] IB/core: fix memory leak on ah on error return path

2017-08-08 Thread Colin Ian King
On 08/08/17 11:20, Johannes Thumshirn wrote: > Shouldn't the subject start with "IB/hns:" given it's touching > drivers/infiniband/hw/hns/hns_roce_ah.c? I was using the same subject start as the patch that introduced the memory leak and touched the same portion of code. I can resend if necessary.

Re: [PATCH] IB/core: fix memory leak on ah on error return path

2017-08-08 Thread Colin Ian King
On 08/08/17 11:20, Johannes Thumshirn wrote: > Shouldn't the subject start with "IB/hns:" given it's touching > drivers/infiniband/hw/hns/hns_roce_ah.c? I was using the same subject start as the patch that introduced the memory leak and touched the same portion of code. I can resend if necessary.

Re: [PATCH] IB/core: fix memory leak on ah on error return path

2017-08-08 Thread Johannes Thumshirn
Shouldn't the subject start with "IB/hns:" given it's touching drivers/infiniband/hw/hns/hns_roce_ah.c? Byte, Johannes -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr.

Re: [PATCH] IB/core: fix memory leak on ah on error return path

2017-08-08 Thread Johannes Thumshirn
Shouldn't the subject start with "IB/hns:" given it's touching drivers/infiniband/hw/hns/hns_roce_ah.c? Byte, Johannes -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr.

[PATCH] IB/core: fix memory leak on ah on error return path

2017-08-08 Thread Colin King
From: Colin Ian King When dmac is NULL, ah is not being freed on the error return path. Fix this by kfree'ing it. Detected by CoverityScan, CID#1452636 ("Resource Leak") Fixes: d8966fcd4c25 ("IB/core: Use rdma_ah_attr accessor functions") Signed-off-by: Colin Ian King

[PATCH] IB/core: fix memory leak on ah on error return path

2017-08-08 Thread Colin King
From: Colin Ian King When dmac is NULL, ah is not being freed on the error return path. Fix this by kfree'ing it. Detected by CoverityScan, CID#1452636 ("Resource Leak") Fixes: d8966fcd4c25 ("IB/core: Use rdma_ah_attr accessor functions") Signed-off-by: Colin Ian King ---