From patchwork Thu Oct 24 14:08:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 177501 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp2247314ill; Thu, 24 Oct 2019 07:11:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvcbO0NT07Bv/I6uKv9h+xg7SzuaEfCuyxeSw5Fm/o+qJ1hLCYrKGGQqEjBQ/MowuQmuEL X-Received: by 2002:aa7:d81a:: with SMTP id v26mr14872537edq.213.1571926303627; Thu, 24 Oct 2019 07:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571926303; cv=none; d=google.com; s=arc-20160816; b=RpjWRsHP49S3uqdCc9YvniqUY8LM0nMApX27kRJTftFSlusAxxXynjcLdQup2K/vnF FqC1qELSPlL/nKB/oY87GJrW0tN8zUmbJqEf7jAmAf2TapomUjwbZ9bU9qxyo/cNYL4n 4ysJVqG2FTh1RHOM81AHqCZi1Ngn1fMf5chyE7X10obfFltRLoYGJxpJQNSrMyVJNCXt H0wIXe8S6aAU89gJJMw/i4TjfJ2u7hq8pTUZBCa8ItybXz+blAQawYTq10tMex1W/lP7 ET/vYi8AWG9ngwJmLTZpF2MGvZFzlkE2/t3GjJNhwDWyplCag09zVK/3z1l3JcnXU7uI MXWQ== 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=Y1oaLHdIPU1ow4tOYDa3LynPWqx9VUqYMqdtUF0jVkE=; b=RVO6xDrhgFa3TQnpC9UANh5oAA+npcM+6wYrwSwPcDspoINPW3e4UVZVcudEWcxM0j g5tUJegPCy4EdV+QfhJcqUyXPBw1HXYjU9Y9Ldy9KNYhzslVn7rf3H7I9eEJ6ov7ffZj PbRKYa4bTPCegeUH7QjnwwcCmHBQU28dNS5VuRPNIU0JofPy/uMP9e1mTFs6wd1QMiJl y1kBxY/VKUyead5UH76Mesi3vslAD4jHjmkES2nzkpl8IX3zSlHetzNfFgQqa5k2xkl5 LeAMiOYMKB5A+UbvM0EK6c2+W1DrYLNy2RHsYj+/wTx9g8bSN/yCxwqRPnRSD/FqQtBZ ht0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-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 f2si6105075eda.339.2019.10.24.07.11.43 for ; Thu, 24 Oct 2019 07:11:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-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-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502590AbfJXOLn (ORCPT ); Thu, 24 Oct 2019 10:11:43 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5162 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2391297AbfJXOLm (ORCPT ); Thu, 24 Oct 2019 10:11:42 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 6C028B73F6A57353BA4E; Thu, 24 Oct 2019 22:11:35 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.439.0; Thu, 24 Oct 2019 22:11:28 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , "John Garry" Subject: [PATCH v2 17/18] scsi: hisi_sas: Delete the debugfs folder of hisi_sas when the probe fails Date: Thu, 24 Oct 2019 22:08:24 +0800 Message-ID: <1571926105-74636-18-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1571926105-74636-1-git-send-email-john.garry@huawei.com> References: <1571926105-74636-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-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 7fa9a5a51b80..669ad7463615 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);