[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190226134121.23650-1-colin.king@canonical.com>
Date: Tue, 26 Feb 2019 13:41:21 +0000
From: Colin King <colin.king@...onical.com>
To: Hannes Reinecke <hare@...e.de>,
James Smart <james.smart@...adcom.com>,
Dick Kennedy <dick.kennedy@...adcom.com>,
"James E . J . Bottomley" <jejb@...ux.ibm.com>,
"Martin K . Petersen" <martin.petersen@...cle.com>,
linux-scsi@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH][next] scsi: lpfc: ensure error is set to -ENODEV on failing exit paths
From: Colin Ian King <colin.king@...onical.com>
A previous commit assigned error to the return value from the call to
dma_set_mask_and_coherent and on the non-failure path error is zero. The
subsequent error return paths now return 0 instead of -ENODEV causing
failures to now be ignored. Fix this by setting error to -ENODEV before
these exit paths. This is indentical to an earlier fix in function
lpfc_sli_pci_mem_setup but accidentally omitted for the function
lpfc_sli4_pci_mem_setup.
Detected by cppcheck ("(warning) Identical condition 'error', second
condition is always false")
Fixes: 56de8357049c ("scsi: lpfc: fix calls to dma_set_mask_and_coherent()")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
drivers/scsi/lpfc/lpfc_init.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 3b5873f6751e..e88c606317e1 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -10064,6 +10064,7 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba)
error = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (error)
return error;
+ error = -ENODEV;
/*
* The BARs and register set definitions and offset locations are
--
2.20.1
Powered by blists - more mailing lists