aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorAlexChen <alex.chen@huawei.com>2020-10-29 21:43:27 +0800
committerMarcel Apfelbaum <marcel.apfelbaum@gmail.com>2020-12-18 20:15:42 +0200
commiteed31bc5e2e9cc68626d51e7a10914dc52c370f8 (patch)
treefa5d0331ea48169f900a90b7861d9c683beb9b0a /contrib
parenta05f8ecd88f15273d033b6f044b850a8af84a5b8 (diff)
downloadqemu-eed31bc5e2e9cc68626d51e7a10914dc52c370f8.zip
qemu-eed31bc5e2e9cc68626d51e7a10914dc52c370f8.tar.gz
qemu-eed31bc5e2e9cc68626d51e7a10914dc52c370f8.tar.bz2
contrib/rdmacm-mux: Fix error condition in hash_tbl_search_fd_by_ifid()
When fd is not found according to ifid, the _hash_tbl_search_fd_by_ifid() returns 0 and assigns the result to *fd, so We have to check that *fd is 0, not that fd is 0. Reported-by: Euler Robot <euler.robot@huawei.com> Signed-off-by: AlexChen <alex.chen@huawei.com> Message-Id: <5F9AC6FF.4000301@huawei.com> Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/rdmacm-mux/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/rdmacm-mux/main.c b/contrib/rdmacm-mux/main.c
index bd82abb..771ca01 100644
--- a/contrib/rdmacm-mux/main.c
+++ b/contrib/rdmacm-mux/main.c
@@ -186,7 +186,7 @@ static int hash_tbl_search_fd_by_ifid(int *fd, __be64 *gid_ifid)
*fd = _hash_tbl_search_fd_by_ifid(gid_ifid);
pthread_rwlock_unlock(&server.lock);
- if (!fd) {
+ if (!*fd) {
syslog(LOG_WARNING, "Can't find matching for ifid 0x%llx\n", *gid_ifid);
return -ENOENT;
}