Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5823828ybp; Tue, 15 Oct 2019 05:42:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXY1wZPnBzSTYCmaqy/xduBsl15HmfxTajq2vaan8Pdz1dqD+Nlo+zlOEoOwZ7DycVvX5G X-Received: by 2002:a17:906:7fd3:: with SMTP id r19mr34557892ejs.46.1571143350244; Tue, 15 Oct 2019 05:42:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571143350; cv=none; d=google.com; s=arc-20160816; b=kPABsYL3gMT0NHFibJekgBGKmkizZnmFCQV0Wg5cO6QdaZ+VJNr8+JYrVO9GU9D+EZ bWtZoMiMIwjueB1mqQL7rh3ErYj3it37/rRlJIv8Z+zcNYl+03zIaQPYmzVkRFiRYaQP c5lEIVcu+9d2WDjhv6agIzerURtN9ZjCOJROHwhQYHEyxJCbfyMgQ5nRF/50IsFKgSm9 cIe5Y69IcXAj9/dWCgfgEtr0n35I8a0HbOyecknuBTiiXAazlJ57ZEeapCGEAK1s4Ts/ QDBrLWsIX9Qk5fxZrZgXLPDyzPLx8t5J6+Imj5MrQeqH3dMBD2oxErADdHTV421XRlIM qeYQ== 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=uuUnqG/Zzzdh614Kh0lV+mjdTD28wNqCxwLiLd0Ll4M=; b=U4SlEWvkAnagaSSI7A4RnmiOkWKmPwUZJGpcWLQR1kZWLGC/1cyt8ns0Hc3fqIUu+D nRbfTJVb0IA+VULaeuNTg1MCMgnfj+YO3jeXNo03kXG2Gtjq4fEAo5j9pSjubz1pjpy4 dfqiEdNjRKv3dDybMFqPyFvVRmIJkNcIhjSnF05W24KgXfHcEhIwvwfo7x8lLres3ye/ rAQ5IStR7wYFN8t8IbgE/z2youpdfRhMC7F7ccyLCM6jP5jz3umefQ+yzkbv8u1RwhAO 3ZYY//qT42d7n+Y+LxWow9a63eFhayPWxWo0uH4D6z5QMLEeHW31ugThC+jkeipJuspd RuDA== 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 90si16589631edj.72.2019.10.15.05.42.05; Tue, 15 Oct 2019 05:42:30 -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 S1728901AbfJOM21 (ORCPT + 99 others); Tue, 15 Oct 2019 08:28:27 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:34280 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726441AbfJOM21 (ORCPT ); Tue, 15 Oct 2019 08:28:27 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 8CE1BBC063981FFFAF3F; Tue, 15 Oct 2019 20:28:25 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.439.0; Tue, 15 Oct 2019 20:28:15 +0800 From: chenxiang To: , CC: , , , Xiang Chen Subject: [PATCH] nfs: No need to add NULL check before function kfree() Date: Tue, 15 Oct 2019 20:25:16 +0800 Message-ID: <1571142316-173812-1-git-send-email-chenxiang66@hisilicon.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Xiang Chen It fixes the warning as follows reported by coccicheck: fs/nfs/sysfs.c:125:2-7: WARNING: NULL check before some freeing functions is not needed. Signed-off-by: Xiang Chen --- 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); } -- 2.8.1