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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CDDFC433FE for ; Sun, 6 Nov 2022 03:16:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229639AbiKFDQP (ORCPT ); Sat, 5 Nov 2022 23:16:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229548AbiKFDQK (ORCPT ); Sat, 5 Nov 2022 23:16:10 -0400 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7217E60FF for ; Sat, 5 Nov 2022 20:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=LEn8xfEmsqrxAEaiNlmZfeu2qHv0CsByUUJAbRlRDws=; b=iwjvNRiMsyNJQ8kwXWiwuayJfeOVXtdWGPDo9Vw7LBB+0w+g3yBgeSBo 1807THi11lH5FSglXtAass4xzrp8c3M8+nQ7kgBAmTGnOWmU+9mrc0Q7O VkX1pFSoz2g4Q13O5+v7pxd3K5GAeZtXKUU56TjumY2vmLi6f3E8ZytYQ c=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.96,141,1665439200"; d="scan'208";a="38577881" Received: from unknown (HELO hadrien) ([129.126.215.52]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2022 04:16:02 +0100 Date: Sun, 6 Nov 2022 11:15:59 +0800 (+08) From: Julia Lawall To: Steven Rostedt cc: Linus Torvalds , linux-kernel@vger.kernel.org, Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton Subject: Re: [PATCH v4a 00/38] timers: Use timer_shutdown*() before freeing timers In-Reply-To: <20221105231241.7513fc33@rorschach.local.home> Message-ID: References: <20221105060024.598488967@goodmis.org> <20221105123642.596371c7@rorschach.local.home> <20221105140356.6a3da628@rorschach.local.home> <20221105144303.3552bf85@rorschach.local.home> <775ada-29f1-3b56-7deb-c1b8d958e2c@inria.fr> <20221105203634.7e0b2e8e@rorschach.local.home> <20221105231241.7513fc33@rorschach.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 5 Nov 2022, Steven Rostedt wrote: > On Sun, 6 Nov 2022 11:05:14 +0800 (+08) > Julia Lawall wrote: > > > > Thinking that's what you meant (examples would be easier to understand, > > > than descriptions). And it didn't cover the return case. Does it only > > > cover gotos? > > > > > > See drivers/net/wireless/intel/iwlwifi/mvm/sta.c for the false positive case: > > > > > > del_timer_sync(&baid_data->session_timer); > > > [..] > > > > But there is a kfree_rcu(baid_data, rcu_head); right below. So it looks > > fine? > > D'oh! I think you are correct. I didn't trust the script and it appears > that it was correct all along. The free was hidden in between the code > and I only noticed the kfree() in the error path. I thought that was a > bug in the script. :-/ > > I guess there were no false positives then. To be sure, I'll write a > script to find all that have a return or goto in between and see what > it comes up with. > > I guess my original patch doesn't need any changes from the script. > I'll look more. You could also consider expression ptr; rather than identifier ptr; if ptr can be eg x->y. But if you have akready found all the calls with the current script, then no need to be more general. julia