iscsi-scst: fix ENOMEM path

In an error path in iscsi_threads_pool_get(), when a new pool cannot be
allocated, if there is a pool on iscsi_thread_pools_list, it passes that back as
an alternative, so return zero in that case.

Signed-off-by: David Butterfield <dab21774@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7143 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2017-04-21 01:32:07 +00:00
parent 0e92843d30
commit 296f133caf

View File

@@ -4240,7 +4240,7 @@ create:
if (p == NULL) {
PRINT_ERROR("Unable to allocate iSCSI thread pool (size %zd)",
sizeof(*p));
res = -ENOMEM;
res = 0;
if (!list_empty(&iscsi_thread_pools_list)) {
PRINT_WARNING("%s", "Using global iSCSI thread pool "
"instead");