From patchwork Tue Feb 26 13:41:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 10830209 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 966D91669 for ; Tue, 26 Feb 2019 13:41:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C7BA2A8C9 for ; Tue, 26 Feb 2019 13:41:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DD2B2B9D5; Tue, 26 Feb 2019 13:41:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF7082A8C9 for ; Tue, 26 Feb 2019 13:41:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726475AbfBZNl1 (ORCPT ); Tue, 26 Feb 2019 08:41:27 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:52227 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725954AbfBZNl1 (ORCPT ); Tue, 26 Feb 2019 08:41:27 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1gycz3-0003G8-Qn; Tue, 26 Feb 2019 13:41:21 +0000 From: Colin King To: Hannes Reinecke , James Smart , Dick Kennedy , "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] scsi: lpfc: ensure error is set to -ENODEV on failing exit paths Date: Tue, 26 Feb 2019 13:41:21 +0000 Message-Id: <20190226134121.23650-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Colin Ian King 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 --- 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