posix: Fix the NULL pointer issue of group.

A single sock connection can call posix_sock_flush,
and this sock may not belong to a polling group.
So add the check in sock_check_zcopy to avoid such issue.

Fixes #1788

Change-Id: Id0a2f80ad0f3cdb7fc736a3be3211e49513751b1
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6334
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
Ziye Yang 2021-02-09 20:33:22 +08:00 committed by Tomasz Zawadzki
parent 8654a1b0cf
commit 0e9ee17642

View File

@ -724,7 +724,7 @@ _sock_check_zcopy(struct spdk_sock *sock)
/* If we reaped buffer reclaim notification and sock is not in pending_recv list yet,
* add it now. It allows to call socket callback and process completions */
if (found && !psock->pending_recv) {
if (found && !psock->pending_recv && group) {
psock->pending_recv = true;
TAILQ_INSERT_TAIL(&group->pending_recv, psock, link);
}