Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2392157pxk; Sun, 27 Sep 2020 06:04:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl0ykbgtbOR2JFMdiolwhBXiLcngiuSB/l4TYBtkeMGUNw2Criu+Hb5G/rdElp62Q8cgEx X-Received: by 2002:a17:906:e88:: with SMTP id p8mr11858624ejf.134.1601211849227; Sun, 27 Sep 2020 06:04:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601211849; cv=none; d=google.com; s=arc-20160816; b=Zr/gEOLQvqeSIqYxi0PICCckrq2Go743pZcsBqifuQx1jjUhhjLt15FSHx/iYtJ+ap tIekx0yI0USp3y7TQYxpFNMXMVPo6curkTJuDs7j/gz90rAxs++NtkbRMppEbdU1Giye 72ipDvuVqUnBK1wWBen2AqA8MuUB1a+NSUG+pc8v9GyyA7dc8Am6F4dH3hPdUKgLLawz stqznMgZlfgHyH99Oe8M/Q0m6dZkEeG8TVItC7j2jKb3OTIFQd4+8TsgjPd0EYbsULhG PycmWSddhxNc2IoP0WgqfW1hJjJ3JpmQV8mXUjI9vDZCIXPG3tmA1IHRiAPuUZa0aLwZ lcUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:subject:cc:to :from:date; bh=08eeqSTaM3a0d3k85cAA8zm9MHoPaGPVVZaXtS3Y9Vg=; b=hze/3CJrSSBsFrymHgQDz83TbALYmAuG9D2ccTn+vSxcHJSEyMj/d/Qhy1OKdyXML2 k/VTdvoAuavjObsfoyb8v99wZqS8Y5LqkZlXiE/GTklr0youIfSdU3TRcyKoC4FHF1M+ BQOgAaYj2YL8oD+i+qUPwe9O25xqjTVKmJCvzOovIleBzKBJtre3OdFm5Ikx2d7J1aNU LMZbh8gNtwy83YJeY6qN2OxpY/pNaOY+rklsUfaBdQFfpq3pZn1zshHhN59lo/YkoSnG EaGptExZnG7wC10vJTpRDJlHx6qjzAa4uELRxeqz2KXEl2CzdLr+c7ZrFTOo9uv659sq m9iw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h17si5515778ejq.747.2020.09.27.06.03.32; Sun, 27 Sep 2020 06:04:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726461AbgI0NAt (ORCPT + 99 others); Sun, 27 Sep 2020 09:00:49 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:33563 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbgI0NAt (ORCPT ); Sun, 27 Sep 2020 09:00:49 -0400 X-IronPort-AV: E=Sophos;i="5.77,310,1596492000"; d="scan'208";a="469726069" Received: from abo-173-121-68.mrs.modulonet.fr (HELO hadrien) ([85.68.121.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Sep 2020 15:00:29 +0200 Date: Sun, 27 Sep 2020 15:00:29 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: "Paul E. McKenney" cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] kvfree_rcu(): fix ifnullfree.cocci warnings Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 Fixes: e9bed2a1239b ("kvfree_rcu(): Switch to kmalloc() and kfree() for allocations") Signed-off-by: kernel test robot Signed-off-by: Julia Lawall --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git urezki-pcount.2020.09.26a head: 1a8eee1cc5b0e59c17f5d94c5871e6c70c4a43a1 commit: e9bed2a1239b017d78cec5de66adce0560f6d077 [17/18] kvfree_rcu(): Switch to kmalloc() and kfree() for allocations :::::: branch date: 4 hours ago :::::: commit date: 15 hours ago tree.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3165,8 +3165,7 @@ static void kfree_rcu_work(struct work_s bkvhead[i] = NULL; krc_this_cpu_unlock(krcp, flags); - if (bkvhead[i]) - kfree(bkvhead[i]); + kfree(bkvhead[i]); cond_resched_tasks_rcu_qs(); }