[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] contrib/rdmacm-mux: Fix error condition in hash_tbl_search_f
From: |
Alex Chen |
Subject: |
Re: [PATCH] contrib/rdmacm-mux: Fix error condition in hash_tbl_search_fd_by_ifid() |
Date: |
Tue, 24 Nov 2020 20:13:36 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 |
Hi everyone,
Who can help me merge this patch into the master branch? This patch may be need
for qemu-5.2
Thanks,
Alex
On 2020/11/4 0:35, Marcel Apfelbaum wrote:
> Hi Alex,
>
> On Thu, Oct 29, 2020 at 3:43 PM AlexChen <alex.chen@huawei.com
> <mailto:alex.chen@huawei.com>> wrote:
>
> 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
> <mailto:euler.robot@huawei.com>>
> Signed-off-by: AlexChen <alex.chen@huawei.com
> <mailto:alex.chen@huawei.com>>
> ---
> contrib/rdmacm-mux/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/rdmacm-mux/main.c b/contrib/rdmacm-mux/main.c
> index bd82abbad3..771ca01e03 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;
> }
> --
> 2.19.1
>
>
> Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com
> <mailto:marcel.apfelbaum@gmail.com>>
>
> Thanks for the fix,
> Marcel
>
>