summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@gmail.com>2021-03-07 19:30:24 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-30 14:40:12 +0200
commit3674bcb773a48f09b2007c8800757e7a2e5ead89 (patch)
treecc2de6c56fbe955582c5fb3545ef36f16b5df63c
parentbe4153fe56ee84d12b101a80ffe7ce67f3c630ca (diff)
downloadlinux-stable-3674bcb773a48f09b2007c8800757e7a2e5ead89.tar.gz
linux-stable-3674bcb773a48f09b2007c8800757e7a2e5ead89.tar.bz2
linux-stable-3674bcb773a48f09b2007c8800757e7a2e5ead89.zip
scsi: qedi: Fix error return code of qedi_alloc_global_queues()
[ Upstream commit f69953837ca5d98aa983a138dc0b90a411e9c763 ] When kzalloc() returns NULL to qedi->global_queues[i], no error return code of qedi_alloc_global_queues() is assigned. To fix this bug, status is assigned with -ENOMEM in this case. Link: https://lore.kernel.org/r/20210308033024.27147-1-baijiaju1990@gmail.com Fixes: ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.") Reported-by: TOTE Robot <oslab@tsinghua.edu.cn> Acked-by: Manish Rangankar <mrangankar@marvell.com> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/scsi/qedi/qedi_main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c
index a742b8856776..b0a404d4e676 100644
--- a/drivers/scsi/qedi/qedi_main.c
+++ b/drivers/scsi/qedi/qedi_main.c
@@ -1354,6 +1354,7 @@ static int qedi_alloc_global_queues(struct qedi_ctx *qedi)
if (!qedi->global_queues[i]) {
QEDI_ERR(&qedi->dbg_ctx,
"Unable to allocation global queue %d.\n", i);
+ status = -ENOMEM;
goto mem_alloc_failure;
}