From 821e673c1df3ff675b20f4a41ab8a31950565929 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Thu, 4 Aug 2022 20:54:46 +0000 Subject: [PATCH] thread: set non-zero status when spdk_for_each_channel fails If spdk_for_each_channel is called on a device that doesn't exist, we need to set a non-zero status (-ENODEV in this case) to the completion function. Signed-off-by: Jim Harris Change-Id: I898ad5ea499fb6087338b621b2befcadd6a05414 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13889 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Community-CI: Broadcom CI Reviewed-by: Dong Yi Reviewed-by: Aleksey Marchuk Reviewed-by: Tomasz Zawadzki --- lib/thread/thread.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/thread/thread.c b/lib/thread/thread.c index d9159b1a6..0fcdc23e9 100644 --- a/lib/thread/thread.c +++ b/lib/thread/thread.c @@ -2381,6 +2381,7 @@ spdk_for_each_channel(void *io_device, spdk_channel_msg fn, void *ctx, if (i->dev == NULL) { SPDK_ERRLOG("could not find io_device %p\n", io_device); assert(false); + i->status = -ENODEV; goto end; }