]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
scsi: qedi: Fix error return code of qedi_alloc_global_queues()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Mon, 8 Mar 2021 03:30:24 +0000 (19:30 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 23 Apr 2021 09:56:12 +0000 (11:56 +0200)
BugLink: https://bugs.launchpad.net/bugs/1923220
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/scsi/qedi/qedi_main.c

index fdd966fea7f6a62b4073fbd342b0b8a173b0633f..4498add3d4d664090e29358a9ad505981ae0d110 100644 (file)
@@ -1605,6 +1605,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;
                }