[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230330023834.97455-1-jiapeng.chong@linux.alibaba.com>
Date: Thu, 30 Mar 2023 10:38:34 +0800
From: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To: martin.petersen@...cle.com
Cc: linux-scsi@...r.kernel.org, target-devel@...r.kernel.org,
linux-kernel@...r.kernel.org,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>,
Abaci Robot <abaci@...ux.alibaba.com>
Subject: [PATCH] scsi: target: return -ENOMEM when kzalloc failed
The driver is using -1 instead of the -ENOMEM defined macro to specify
that a buffer allocation failed.
drivers/target/iscsi/iscsi_target.c:691 iscsi_target_init_module() warn: returning -1 instead of -ENOMEM is sloppy.
Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4644
Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
---
drivers/target/iscsi/iscsi_target.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 834cce50f9b0..d3a40c3caaf5 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -688,7 +688,7 @@ static int __init iscsi_target_init_module(void)
pr_debug("iSCSI-Target "ISCSIT_VERSION"\n");
iscsit_global = kzalloc(sizeof(*iscsit_global), GFP_KERNEL);
if (!iscsit_global)
- return -1;
+ return -ENOMEM;
spin_lock_init(&iscsit_global->ts_bitmap_lock);
mutex_init(&auth_id_lock);
--
2.20.1.7.g153144c
Powered by blists - more mailing lists