From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 345A042124A for ; Wed, 12 Aug 2026 10:22:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786530128; cv=none; b=uHHELQhl5i8q/44QvxxotdyfxRLVefQRSJbOvV7wrcoj8p8SBHExnmHJqkX58WCmJ1XYu2Mu5tjHsWl6RAnsyKtgfYDGaOOiSCY4MPVXIb0sancwDUrViaiLGJwqKvoHyU9r75buehD0pngrov/rDk5K9cfFc5uO3Yf+W45FbYc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786530128; c=relaxed/simple; bh=rMk/svegSyNe/bi/7a0UY6WoyU5TQJsXI7iiZS0lI2o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=f+653hSG2VYgTIv+Lt1555V1KoiKec8XVGI5vMSerYRDKEYdg7KopnOS9MThieIhMGZAhmHqV4ZM4zIsbN5nMNL67rtBwWuWciavUaCQK8fahA+OLbN8Ncz0uJxDFkt3pO8GwrQd9e61PUT81piacnO1IW/Ad4NjvnIV9bwmaD4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp; spf=pass smtp.mailfrom=sakamocchi.jp; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b=Q9mgtrYS; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=HgF941SV; arc=none smtp.client-ip=202.12.124.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="Q9mgtrYS"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="HgF941SV" Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id E94D37A0140; Wed, 12 Aug 2026 06:22:01 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Wed, 12 Aug 2026 06:22:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1786530121; x= 1786616521; bh=9t9yJIq5rW1c9VY3xUbftYAu9/KtjMOScxK1CLEVU7Y=; b=Q 9mgtrYSQ7jMx25/HXKIZ6MMJmtrn/c82nn41x2qn2ogCfxR/qXn+x56mTPjro9rO v1EvtQVp78z2yiLvHhkV7Dhz/Soqqpn8+8K3c4i83Xwa1orLizIs4wWloUoIrNvu bx7LCBAafZMFsXUByeUl7o3e0wIYmEoIK8BGrI/vjNUf+iEPX8G5u6fEAKu3kk4d y2tloath9e2PPsW9mwJR1uIAEa7XLyYfl4bVbDORW/qkY0qtK40o0lmuC7NafcSH lXsElwsW5yTiPmjqIVzkTKOXRzvbpP6U+AytgdhxV4gis0uc+eHnhJr4gTi35ZBT Yh7ZO7T6/NJUohYh2Bb2Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm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zme9RzHZZOy3gxyPGGJP Nb0UB/mvXHIfAcW9Iv3bhjOYZuWsPOz0u922zQVEMul+20mwp/m3QVuyhGqw X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Aug 2026 06:22:00 -0400 (EDT) Date: Wed, 12 Aug 2026 19:21:58 +0900 From: Takashi Sakamoto To: Abdun Nihaal Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] firewire: core: fix memory leak in error path of build_tree() Message-ID: <20260812102158.GA719477@sakamocchi.jp> Mail-Followup-To: Abdun Nihaal , linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20260811120928.700577-1-o-takashi@sakamocchi.jp> <20260811120928.700577-4-o-takashi@sakamocchi.jp> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi, On Wed, Aug 12, 2026 at 02:35:36PM +0530, Abdun Nihaal wrote: > On Tue, Aug 11, 2026 at 09:09:28PM +0900, Takashi Sakamoto wrote: > > In the error path of build_tree(), node instances can remain in the local > > linked list when the function returns. > > > > Whenever an invalid value is detected in the self ID sequence, each > > allocated node instance is either an entry in the linked list or an > > entry in the ports array of its parent node. Therefore, the allocate > > node instances can be safely released by traversing the linked list from > > its head. > > > > Release the remaining node instances with for_each_fw_node() before > > returning to the caller. > > > > Fixes: 3038e353cfaf ("firewire: Add core firewire stack.") > > Reported-by: Abdun Nihaal > > Link: https://lore.kernel.org/all/20260727095955.104972-1-nihaal@cse.iitm.ac.in/ > > Signed-off-by: Takashi Sakamoto > > Looks good to me. Thanks for fixing this. > > I don't have a proper understanding of how the Firewire topology > construction happens, and was a bit confused by how the node->color > is used in the code, that's why I couldn't follow up with the fix. Yea. How the color member of fw_node/fw_card works was unclear to me too. Writing some KUnit tests finally brought it to me. Anyway, thank for your pointing and working for the issue. Regards Takashi Sakamoto