From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8B0EC433E5 for ; Mon, 27 Jul 2020 10:42:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA8B820719 for ; Mon, 27 Jul 2020 10:42:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728198AbgG0KmT (ORCPT ); Mon, 27 Jul 2020 06:42:19 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:62798 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbgG0KmR (ORCPT ); Mon, 27 Jul 2020 06:42:17 -0400 X-IronPort-AV: E=Sophos;i="5.75,402,1589234400"; d="scan'208";a="461462773" Received: from dt-lawall.paris.inria.fr ([128.93.67.65]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jul 2020 12:42:15 +0200 Date: Mon, 27 Jul 2020 12:42:15 +0200 (CEST) From: Julia Lawall X-X-Sender: julia@hadrien To: Pascal Bouchareine cc: kbuild-all@lists.01.org, Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] proc,fcntl: fix ifnullfree.cocci warnings Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: kernel test robot NULL check before kfree is not needed. Generated by: scripts/coccinelle/free/ifnullfree.cocci CC: Pascal Bouchareine Signed-off-by: kernel test robot Signed-off-by: Julia Lawall --- tree: https://github.com/0day-ci/linux/commits/UPDATE-20200726-101057/Pascal-Bouchareine/proc-fcntl-introduce-F_SET_DESCRIPTION/20200726-053047 head: 56b3babdfa5600eeed065807fd6e80d150b1766b commit: 56b3babdfa5600eeed065807fd6e80d150b1766b [1/1] proc,fcntl: introduce F_SET_DESCRIPTION :::::: branch date: 27 hours ago :::::: commit date: 27 hours ago Please take the patch only if it's a positive warning. Thanks! file_table.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/fs/file_table.c +++ b/fs/file_table.c @@ -272,8 +272,7 @@ static void __fput(struct file *file) eventpoll_release(file); locks_remove_file(file); - if (file->f_description) - kfree(file->f_description); + kfree(file->f_description); ima_file_free(file); if (unlikely(file->f_flags & FASYNC)) {