|
|
fa196d |
From 9f25aebffc4f6d4d9b7ccf3e1ba911b997fb9ab4 Mon Sep 17 00:00:00 2001
|
|
|
fa196d |
From: Honggang Li <honli@redhat.com>
|
|
|
fa196d |
Date: Sun, 15 Nov 2020 17:53:47 +0800
|
|
|
fa196d |
Subject: [PATCH] qedr: fix USE_AFTER_FREE issue
|
|
|
fa196d |
|
|
|
fa196d |
[ Upstream commit 56137398dbd58f876cb6238da9babb9500ac38b4 ]
|
|
|
fa196d |
|
|
|
fa196d |
Issue was detected by Coverity.
|
|
|
fa196d |
|
|
|
fa196d |
Error: USE_AFTER_FREE (CWE-416): [#def10]
|
|
|
fa196d |
rdma-core-33.0/providers/qedr/qelr_verbs.c:2678: freed_arg: "free" frees "srq".
|
|
|
fa196d |
rdma-core-33.0/providers/qedr/qelr_verbs.c:2680: pass_freed_arg: Passing freed pointer "srq" as an argument to "fprintf".
|
|
|
fa196d |
|# 2678| free(srq);
|
|
|
fa196d |
|# 2679| err0:
|
|
|
fa196d |
|# 2680|-> DP_ERR(cxt->dbg_fp,
|
|
|
fa196d |
|# 2681| "create srq: failed to create %p. rc=%d\n", srq, rc);
|
|
|
fa196d |
|# 2682| return NULL;
|
|
|
fa196d |
|
|
|
fa196d |
Fixes: cae4a99ae679 ("libqedr: add support for XRC-SRQ's.")
|
|
|
fa196d |
Signed-off-by: Honggang Li <honli@redhat.com>
|
|
|
fa196d |
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
|
|
|
fa196d |
---
|
|
|
fa196d |
providers/qedr/qelr_verbs.c | 2 +-
|
|
|
fa196d |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
fa196d |
|
|
|
fa196d |
diff --git a/providers/qedr/qelr_verbs.c b/providers/qedr/qelr_verbs.c
|
|
|
fa196d |
index 4e77a1976a91..e75d508f100b 100644
|
|
|
fa196d |
--- a/providers/qedr/qelr_verbs.c
|
|
|
fa196d |
+++ b/providers/qedr/qelr_verbs.c
|
|
|
fa196d |
@@ -2678,7 +2678,7 @@ err1:
|
|
|
fa196d |
free(srq);
|
|
|
fa196d |
err0:
|
|
|
fa196d |
DP_ERR(cxt->dbg_fp,
|
|
|
fa196d |
- "create srq: failed to create %p. rc=%d\n", srq, rc);
|
|
|
fa196d |
+ "create srq: failed to create. rc=%d\n", rc);
|
|
|
fa196d |
return NULL;
|
|
|
fa196d |
}
|
|
|
fa196d |
|
|
|
fa196d |
--
|
|
|
fa196d |
2.25.4
|
|
|
fa196d |
|