diff mbox series

[v2,rdma-core] cxgb4: free appropriate pointer in error case

Message ID 1572870345-8629-1-git-send-email-bharat@chelsio.com (mailing list archive)
State Accepted
Headers show
Series [v2,rdma-core] cxgb4: free appropriate pointer in error case | expand

Commit Message

Potnuri Bharat Teja Nov. 4, 2019, 12:25 p.m. UTC
error unmap case wrongly frees only the cqid2ptr for qp/mmid2ptr.
This patch frees the appropriate pointer.

Fixes: 9b2d3af5735e ("Query device to get the max supported stags, qps, and cqs")
Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
---
v0 -> v1:
- add missing description
---
 providers/cxgb4/dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Leon Romanovsky Nov. 5, 2019, 2:46 p.m. UTC | #1
On Mon, Nov 04, 2019 at 05:55:45PM +0530, Potnuri Bharat Teja wrote:
> error unmap case wrongly frees only the cqid2ptr for qp/mmid2ptr.
> This patch frees the appropriate pointer.
>
> Fixes: 9b2d3af5735e ("Query device to get the max supported stags, qps, and cqs")
> Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
> ---
> v0 -> v1:
> - add missing description
> ---
>  providers/cxgb4/dev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Thanks, applied.
diff mbox series

Patch

diff --git a/providers/cxgb4/dev.c b/providers/cxgb4/dev.c
index 7f5955449ca1..4d02c7a91892 100644
--- a/providers/cxgb4/dev.c
+++ b/providers/cxgb4/dev.c
@@ -203,9 +203,9 @@  err_free:
 	if (rhp->cqid2ptr)
 		free(rhp->cqid2ptr);
 	if (rhp->qpid2ptr)
-		free(rhp->cqid2ptr);
+		free(rhp->qpid2ptr);
 	if (rhp->mmid2ptr)
-		free(rhp->cqid2ptr);
+		free(rhp->mmid2ptr);
 	verbs_uninit_context(&context->ibv_ctx);
 	free(context);
 	return NULL;