Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp89044imm; Thu, 20 Sep 2018 19:00:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaPVwWc8Ee0mlPiXPZaOpRb+xJbGr1oBrU39WLQtWRN6Has1WB5tc3zY0P6ss7B6dTkTCUQ X-Received: by 2002:a63:3642:: with SMTP id d63-v6mr38506523pga.231.1537495224863; Thu, 20 Sep 2018 19:00:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537495224; cv=none; d=google.com; s=arc-20160816; b=rQvpbSRogW/2DXsWkghQBW4pKOXj/T6+pxQf7UrcriH8ayXss7lCbtAAZp9mXnz+6b ngJ1UDgdERGccBdSQ0dNAlAcj3qKnZ9pepOpERbUzD6ceo77Fve3ABKpxyEifH2Kzf+0 sdhtUAyDNUKkpVfcSSbpAQH73G5rvEohRbNYj0dnyHgpDZZMlOi38yP/Z5s5AnG+Q1TU vvYkchGR196GbrwbKM5lBiIXCYvZbIhtd1I59/tudUEJ22OtjyPeYREo5fF18ytH03i5 emZUIXwwDM89WNGUafoTHiuqZz3kZGe8kQ6GgkYtiI+GuYL/mdwJPFDbBj5DvPytX9mX rqZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=0M+PYfywsn+9pwfNHKcGAiVhyEF8y021T/YnB45P8Hg=; b=BNuaH8u3cgTRs2uxTLlJI/jyTn9hKa1soJef5RXex/TGcnHggMotRW3dTX2G29KQY3 7vrXJ2BAxlmwjmOouCcGVZ3FGx8r9SAl03Cj6d/znKTclgdRbqGD8YwvrnUq7wwW/m/S PK6h52PIy69fBkpeEhIknPmn2F0m9GnzhchVA2UGA+LTgx941YEx0LnnFz/4O5LfqUf/ RCSX/8McGXWN12nY3A3XvJkA2TBUkAscit9T+xrAgyLKwsPxwaM0CyelBHJYNt/K4IiA n5KBsmZrE+2S5ap5M0SauQwXn3M7f7JLcotqyxVEnu2VkPC8fHa/gOcpeYREKtrvY6X5 QKUg== 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 9-v6si421351plf.345.2018.09.20.19.00.09; Thu, 20 Sep 2018 19:00:24 -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 S2388936AbeIUHpl (ORCPT + 99 others); Fri, 21 Sep 2018 03:45:41 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:35656 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725855AbeIUHpl (ORCPT ); Fri, 21 Sep 2018 03:45:41 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 1ACD0FC5E585; Fri, 21 Sep 2018 09:59:10 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.399.0; Fri, 21 Sep 2018 09:59:08 +0800 From: zhong jiang To: CC: , , , , Subject: [RESEND PATCH] error-injection: remove meaningless null pointer check before debugfs_remove_recursive Date: Fri, 21 Sep 2018 09:46:44 +0800 Message-ID: <1537494404-16473-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org debugfs_remove_recursive has taken the null pointer into account. just remove the null check before debugfs_remove_recursive. Acked-by: Masami Hiramatsu Signed-off-by: zhong jiang --- kernel/fail_function.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/fail_function.c b/kernel/fail_function.c index bc80a4e..17f75b5 100644 --- a/kernel/fail_function.c +++ b/kernel/fail_function.c @@ -173,8 +173,7 @@ static void fei_debugfs_remove_attr(struct fei_attr *attr) struct dentry *dir; dir = debugfs_lookup(attr->kp.symbol_name, fei_debugfs_dir); - if (dir) - debugfs_remove_recursive(dir); + debugfs_remove_recursive(dir); } static int fei_kprobe_handler(struct kprobe *kp, struct pt_regs *regs) -- 1.7.12.4