From patchwork Wed Jan 17 12:42:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 10169229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 23EDB603ED for ; Wed, 17 Jan 2018 12:36:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 122512855C for ; Wed, 17 Jan 2018 12:36:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 069172855E; Wed, 17 Jan 2018 12:36:31 +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=-6.9 required=2.0 tests=BAYES_00,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 708E72855C for ; Wed, 17 Jan 2018 12:36:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752918AbeAQMg2 (ORCPT ); Wed, 17 Jan 2018 07:36:28 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:4238 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752738AbeAQMg1 (ORCPT ); Wed, 17 Jan 2018 07:36:27 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id DDEAC3A50374A; Wed, 17 Jan 2018 20:36:11 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.361.1; Wed, 17 Jan 2018 20:36:05 +0800 From: Wei Yongjun To: "James E.J. Bottomley" , "Martin K. Petersen" CC: Wei Yongjun , , , Subject: [PATCH -next] scsi: qedf: Fix error return code in __qedf_probe() Date: Wed, 17 Jan 2018 12:42:41 +0000 Message-ID: <1516192961-52789-1-git-send-email-weiyongjun1@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected 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 Fix to return error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun Acked-by: Chad Dupuis --- drivers/scsi/qedf/qedf_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 40800dd..ccd9a08 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -3126,6 +3126,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) qedf->cmd_mgr = qedf_cmd_mgr_alloc(qedf); if (!qedf->cmd_mgr) { QEDF_ERR(&(qedf->dbg_ctx), "Failed to allocate cmd mgr.\n"); + rc = -ENOMEM; goto err5; } @@ -3149,6 +3150,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) create_workqueue(host_buf); if (!qedf->ll2_recv_wq) { QEDF_ERR(&(qedf->dbg_ctx), "Failed to LL2 workqueue.\n"); + rc = -ENOMEM; goto err7; } @@ -3192,6 +3194,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) if (!qedf->timer_work_queue) { QEDF_ERR(&(qedf->dbg_ctx), "Failed to start timer " "workqueue.\n"); + rc = -ENOMEM; goto err7; }