From patchwork Sun Jul 7 16:45:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 11034163 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D66D214F6 for ; Sun, 7 Jul 2019 16:45:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA2361FF66 for ; Sun, 7 Jul 2019 16:45:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A764926D08; Sun, 7 Jul 2019 16:45:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF37C1FF66 for ; Sun, 7 Jul 2019 16:45:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727341AbfGGQpk (ORCPT ); Sun, 7 Jul 2019 12:45:40 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:59302 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727335AbfGGQpk (ORCPT ); Sun, 7 Jul 2019 12:45:40 -0400 X-IronPort-AV: E=Sophos;i="5.63,463,1557180000"; d="scan'208";a="390776152" Received: from abo-12-105-68.mrs.modulonet.fr (HELO hadrien) ([85.68.105.12]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jul 2019 18:45:38 +0200 Date: Sun, 7 Jul 2019 18:45:38 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Trond Myklebust cc: Anna Schumaker , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, kbuild-all@01.org Subject: [PATCH] NFS: fix ifnullfree.cocci warnings Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: kbuild test robot fs/nfs/sysfs.c:125:2-7: WARNING: NULL check before some freeing functions is not needed. NULL check before some freeing functions is not needed. Based on checkpatch warning "kfree(NULL) is safe this check is probably not required" and kfreeaddr.cocci by Julia Lawall. Generated by: scripts/coccinelle/free/ifnullfree.cocci Fixes: bf11fbdb20b3 ("NFS: Add sysfs support for per-container identifier") Signed-off-by: kbuild test robot Signed-off-by: Julia Lawall --- tree: git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next head: c433a7975cfc839906aaa891f68d86ca228f7e43 commit: bf11fbdb20b385157b046ea7781f04d0c62554a3 [30/57] NFS: Add sysfs support for per-container identifier :::::: branch date: 22 hours ago :::::: commit date: 22 hours ago Please take the patch only if it's a positive warning. Thanks! sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/fs/nfs/sysfs.c +++ b/fs/nfs/sysfs.c @@ -121,8 +121,7 @@ static void nfs_netns_client_release(str struct nfs_netns_client, kobject); - if (c->identifier) - kfree(c->identifier); + kfree(c->identifier); kfree(c); }