From patchwork Mon Jul 27 10:42:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 11686723 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E2E0C913 for ; Mon, 27 Jul 2020 10:42:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D24852065E for ; Mon, 27 Jul 2020 10:42:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728185AbgG0KmS (ORCPT ); Mon, 27 Jul 2020 06:42:18 -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 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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)) {