96ca5f
From 2e940ac7836816efa47be134725934e9150c93db Mon Sep 17 00:00:00 2001
96ca5f
From: Potnuri Bharat Teja <bharat@chelsio.com>
96ca5f
Date: Thu, 31 Oct 2019 16:05:59 +0530
96ca5f
Subject: [PATCH rdma-core 2/5] cxgb4: free appropriate pointer in error case
96ca5f
96ca5f
[ Upstream commit 151068ef86cc28d75b4cd73906b79c52fe55ee9c ]
96ca5f
96ca5f
error unmap case wrongly frees only the cqid2ptr for qp/mmid2ptr.
96ca5f
This patch frees the appropriate pointer.
96ca5f
96ca5f
Fixes: 9b2d3af5735e ("Query device to get the max supported stags, qps, and cqs")
96ca5f
Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
96ca5f
---
96ca5f
v0 -> v1:
96ca5f
- add missing description
96ca5f
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
96ca5f
---
96ca5f
 providers/cxgb4/dev.c | 4 ++--
96ca5f
 1 file changed, 2 insertions(+), 2 deletions(-)
96ca5f
96ca5f
diff --git a/providers/cxgb4/dev.c b/providers/cxgb4/dev.c
96ca5f
index aba007f0..1377cf87 100644
96ca5f
--- a/providers/cxgb4/dev.c
96ca5f
+++ b/providers/cxgb4/dev.c
96ca5f
@@ -203,9 +203,9 @@ err_free:
96ca5f
 	if (rhp->cqid2ptr)
96ca5f
 		free(rhp->cqid2ptr);
96ca5f
 	if (rhp->qpid2ptr)
96ca5f
-		free(rhp->cqid2ptr);
96ca5f
+		free(rhp->qpid2ptr);
96ca5f
 	if (rhp->mmid2ptr)
96ca5f
-		free(rhp->cqid2ptr);
96ca5f
+		free(rhp->mmid2ptr);
96ca5f
 	verbs_uninit_context(&context->ibv_ctx);
96ca5f
 	free(context);
96ca5f
 	return NULL;
96ca5f
-- 
96ca5f
2.20.1
96ca5f