From d9442eaa1825308ea19be77867f65a9a2a89ca4c Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Sun, 26 Jun 2022 18:18:29 +0300 Subject: [PATCH] iscsi-scst: Fix use of uninitialized struct field This patch fixes the following Coverity complaint: CID 271606 (#1 of 1): Uninitialized scalar variable (UNINIT) uninit_use_in_call: Using uninitialized value event. Field event.target_name is uninitialized when calling __event_send. --- iscsi-scst/include/iscsi_scst.h | 1 - iscsi-scst/kernel/event.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/iscsi-scst/include/iscsi_scst.h b/iscsi-scst/include/iscsi_scst.h index 11d942284..c7c44994e 100644 --- a/iscsi-scst/include/iscsi_scst.h +++ b/iscsi-scst/include/iscsi_scst.h @@ -193,7 +193,6 @@ struct iscsi_kern_event { u32 cid; u32 code; u32 cookie; - char target_name[ISCSI_NAME_LEN]; u32 param1_size; u32 param2_size; }; diff --git a/iscsi-scst/kernel/event.c b/iscsi-scst/kernel/event.c index 047cddd48..f40234c93 100644 --- a/iscsi-scst/kernel/event.c +++ b/iscsi-scst/kernel/event.c @@ -129,7 +129,7 @@ int event_send(u32 tid, u64 sid, u32 cid, u32 cookie, { int err; static DEFINE_MUTEX(event_mutex); - struct iscsi_kern_event event; + struct iscsi_kern_event event = {}; int param1_size, param2_size; param1_size = (param1 != NULL) ? strlen(param1) : 0;