From dedfde13d4e90777b011b32ef4fb36bafbfa6f6a Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Thu, 19 Sep 2024 10:46:49 +0200 Subject: [PATCH] Fix error handling in file_open_ipc_handle() Fix error handling in file_open_ipc_handle(). It fixes the Coverity issue no. 469239. Signed-off-by: Lukasz Dorau --- src/provider/provider_file_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/provider/provider_file_memory.c b/src/provider/provider_file_memory.c index fd8d04371..e366a1553 100644 --- a/src/provider/provider_file_memory.c +++ b/src/provider/provider_file_memory.c @@ -582,7 +582,7 @@ static umf_result_t file_open_ipc_handle(void *provider, void *providerIpcData, } fd = os_file_open(file_ipc_data->path); - if (fd <= 0) { + if (fd == -1) { LOG_PERR("opening the file to be mapped (%s) failed", file_ipc_data->path); return UMF_RESULT_ERROR_INVALID_ARGUMENT;