From patchwork Mon Oct 21 16:22:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 177106 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3635434ill; Mon, 21 Oct 2019 09:25:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyK793xsWh1UWCkbI/ljPRgJBUDdRZK+S2jouSpeROKeg6GC6BuGYTI/Nu/IVhFCFxwPHA2 X-Received: by 2002:a50:b966:: with SMTP id m93mr25615122ede.228.1571675147481; Mon, 21 Oct 2019 09:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571675147; cv=none; d=google.com; s=arc-20160816; b=gdOgzKXn6pFB9Ph8mAgV/nJnrJqnIie1aT9EqWdPgLblV5YI3lN88Ua1YIDNtHbUJ/ IfTsrdPw1vFGVTMhmCTaEhr5V/oUnT+GUMQ4k8QAeubU83EI/5WB1ZiQ18S5QPIKJGah /oMPmnk1saij1grtYBAjKFQ5DjugVoEs7jgCBdRdk87dkao1LFMBifRaRSEY6/mYmAUO B3/f8Cn3pvJ2snQHsrJXdQKYQLOeRL8Q9HsgRoP1d/4DfIhiG9BW7/b+vfX+nCJh5h+J JQSyQWyKh2N5kj56ggtnRqgQSibiw64GpjHJE+G7fS8U2qsulAvUqvkft+nxWqnoq1Hs j6bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=3Ty/tcdIHv2MAChqq2LF3G1gG6Y/dBHYwDM75TTJATE=; b=j0IfiOq63KJAPAzvIk3l4NHykd523Zp7J2uE92iAqWiHgV/qgjjuwi5kxt40BnmORK NiqlCRpdiEJdpaPfl/z4Cu5FsOkeE9RKByVf7yhVm69QSgmhqIWuMoE89a1LmJntT5P5 WcRCd+dYeubYQY7MQzJ/NbTonOMqScQEGA5qzWb6oir3V/OS18TCqVwJ9/eOZQoX5Y7x SrctBqOrx1eg+RUsqlUw4RZuUjkNVi3eGk82S1aITk/+JwhPvUxgnrurnTc+Xp5VJLx5 IReOICclBdAM+4b6Qe8BcW+QxxjGHFPgCQ/6/S1T0yunY7OlmJwxhgXi7Z3LB26ubzsu xFIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n8si9138921ejh.169.2019.10.21.09.25.47; Mon, 21 Oct 2019 09:25:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729984AbfJUQZn (ORCPT + 26 others); Mon, 21 Oct 2019 12:25:43 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:36572 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729923AbfJUQZj (ORCPT ); Mon, 21 Oct 2019 12:25:39 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 2602FFA9348768EBD469; Tue, 22 Oct 2019 00:25:30 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Tue, 22 Oct 2019 00:25:21 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , "John Garry" Subject: [PATCH 17/18] scsi: hisi_sas: Delete the debugfs folder of hisi_sas when the probe fails Date: Tue, 22 Oct 2019 00:22:14 +0800 Message-ID: <1571674935-108326-18-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1571674935-108326-1-git-send-email-john.garry@huawei.com> References: <1571674935-108326-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luo Jiaxing Although if the debugfs initialization fails, we will delete the debugfs folder of hisi_sas, but we did not consider the scenario where debugfs was successfully initialized, but the probe failed for other reasons. We found out that hisi_sas folder is still remain after the probe failed. When probe fail, we should delete debugfs folder to avoid the above issue. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 1 + drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 + 2 files changed, 2 insertions(+) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index f6ee8db6298f..a225f885b708 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -2686,6 +2686,7 @@ int hisi_sas_probe(struct platform_device *pdev, err_out_register_ha: scsi_remove_host(shost); err_out_ha: + hisi_sas_debugfs_exit(hisi_hba); hisi_sas_free(hisi_hba); scsi_host_put(shost); return rc; diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 19a8cfeb8f6e..e4da309009c0 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -3266,6 +3266,7 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) err_out_register_ha: scsi_remove_host(shost); err_out_ha: + hisi_sas_debugfs_exit(hisi_hba); scsi_host_put(shost); err_out_regions: pci_release_regions(pdev);