]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
scsi: fnic: Fix error return code in fnic_probe()
authorZhang Changzhong <zhangchangzhong@huawei.com>
Fri, 4 Dec 2020 07:47:39 +0000 (15:47 +0800)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 4 Jan 2021 15:37:23 +0000 (16:37 +0100)
BugLink: https://bugs.launchpad.net/bugs/1910111
[ Upstream commit d4fc94fe65578738ded138e9fce043db6bfc3241 ]

Return a negative error code from the error handling case instead of 0 as
done elsewhere in this function.

Link: https://lore.kernel.org/r/1607068060-31203-1-git-send-email-zhangchangzhong@huawei.com
Fixes: 5df6d737dd4b ("[SCSI] fnic: Add new Cisco PCI-Express FCoE HBA")
Reported-by: Hulk Robot <hulkci@huawei.com>
Reviewed-by: Karan Tilak Kumar <kartilak@cisco.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/scsi/fnic/fnic_main.c

index 5f8a7ef8f6a8e1148c5f271af961589f2836e9fc..4f7befb43d60407709c9045fa85de78a26b31169 100644 (file)
@@ -740,6 +740,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        for (i = 0; i < FNIC_IO_LOCKS; i++)
                spin_lock_init(&fnic->io_req_lock[i]);
 
+       err = -ENOMEM;
        fnic->io_req_pool = mempool_create_slab_pool(2, fnic_io_req_cache);
        if (!fnic->io_req_pool)
                goto err_out_free_resources;