Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1526799ybe; Mon, 2 Sep 2019 23:08:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0mIS0St+OVpFS5SaYS8i6dkiJRetaRvXDUtRWmHZ8HpRu8GPc13Nn+GqK2TeVmluHpQlF X-Received: by 2002:a65:43c2:: with SMTP id n2mr28813605pgp.110.1567490903534; Mon, 02 Sep 2019 23:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567490903; cv=none; d=google.com; s=arc-20160816; b=0vlKEbsdch/437OV2EKAxwwotSR68PB9+xAfDA2HG0mlwRKLXuZlPEjkx19Nf7RWU0 RG1+TJW8NeGo6CnTfP3N23wOS5N0wE1IsThnWf9QJzGd5q++odFtV1NfewXh0UpGO395 +iAIyy8yAGj8w+R7C++1S9gh05jlhZ3Fl20gERscocqBNnW/z7X5ereO3ce+o2JxqNXM lz3BazDpeQ+vYT7OsxbSgYA6Ln6sB1EaZMOokEsfmVTCVMIh9LsLs2s7e0GotklWXRrJ Lgf5ry748Z6zk30jjizeBOuCRVQWVESMhx/rlAKkpZi3+CrIkRPUQjBMdPvUaOxNpid4 mgbQ== 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=5CQ3uZyIBKvJ7/D7FxdhAkiaNVAkxyLL7EtHNY5/Lt4=; b=xXsqd9GDXrTkHEhEu6KzzoIf5NSagjALy57khQXxhZMqSZpagWltTlLGii33SbJ2HA ZQtXp2FTxclL12LS32aV5Ty9dNT2v2bUHmqaRkMTF33pKRyQGCLf7cuYdq4LGGITvo4J Iw3QTKKIW2nxfDimPXyU1bfSR89n75TO7YDpPLb4fAWW8erR8EwjJxWsh02Ko6rDr78s KM+q0Nl+4E8NG9v8MpJ6/JDNdt7hGWK0s/BNzcM0k7QOxqnItXsxsCcURHS25UCfKc1t mW0ctkPPuap6hoZLaDlpSW7IZ7APbRePNzG1bRoZDvv9gVAamesULoK7CugCBJH/kjV0 F8Xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-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 w18si6572962pfn.277.2019.09.02.23.07.57; Mon, 02 Sep 2019 23:08:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-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-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726016AbfICGHz (ORCPT + 99 others); Tue, 3 Sep 2019 02:07:55 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6182 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725848AbfICGHz (ORCPT ); Tue, 3 Sep 2019 02:07:55 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 319848146146BA4DE1DF; Tue, 3 Sep 2019 14:07:52 +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.439.0; Tue, 3 Sep 2019 14:07:41 +0800 From: zhong jiang To: , CC: , , Subject: [PATCH] NFS: remove the redundant check when kfree an object in nfs_netns_client_release Date: Tue, 3 Sep 2019 14:04:48 +0800 Message-ID: <1567490688-17872-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-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org kfree has taken the null check in account. hence it is unnecessary to add the null check before kfree the object. Just remove it. Signed-off-by: zhong jiang --- fs/nfs/sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/nfs/sysfs.c b/fs/nfs/sysfs.c index 4f3390b..c489496 100644 --- a/fs/nfs/sysfs.c +++ b/fs/nfs/sysfs.c @@ -121,8 +121,7 @@ static void nfs_netns_client_release(struct kobject *kobj) struct nfs_netns_client, kobject); - if (c->identifier) - kfree(c->identifier); + kfree(c->identifier); kfree(c); } -- 1.7.12.4