From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 37A07299AB5; Thu, 13 Nov 2025 02:12:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762999970; cv=none; b=ueGfy+DaQHz7Cc8Y+slZEoKmmhM/Sl7apX3RctZGrV/8pr1OKktPKUwNfJ2Nzs8VX3lPz3RdyFadWPXuPD6oVsoRoFFBI9hB4bssi3ahXrSi455ja8qlKtrqrpr19EwY9/aLvfoaMHFFBHrTLQMrkPyU406ZykbNt4xLdNlXS9E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762999970; c=relaxed/simple; bh=flGmFZhoOXR2YxO/YWjefEuhtv6mAu2jpcpOx7T+HB8=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ptt/mrfCsj9HtwGCf/vK1AqoO8QDBpxmyn8uelPKtGZVhGz3O5pZ6eZBPbQLIq7TEn+ITlvu6S4dJ19w8S8W2zFKxZMj7FIkYsT5L7UD1OvBybBDHxKMepvevdCIcKgGY6uplJWaMv2Ah1zjug6kV20aXhTRebCVP9nwCWj/c/c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Tg5RbcIU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Tg5RbcIU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06DBAC116B1; Thu, 13 Nov 2025 02:12:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762999969; bh=flGmFZhoOXR2YxO/YWjefEuhtv6mAu2jpcpOx7T+HB8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Tg5RbcIUqLdNPG1DDHChGLXBZnnLyA46EYb2O5DY6H89g/ZKulLMxjLNOx7X9TEPM 2lhpA3gdZzij2wmcOtrec61fkOb2c78eeODzy5Y24ZEKd+7ufwa8tXvFpTGhq8uLWD +Q/9Le/22xbhyVf4tCKsvqAhUiwJFhxsr/lusyPOKrelT/TWiRF1wRw+8aNeXuszoV e60zbxiSbitEcT6RJnVHOe5Z7X6B/5Sn6EROHOs44Ob5BpjgV5IZTjNkPPgNVIM/0h DsSKWM1bvzbr1CacfAQ5fn9Le4Uvg4gcZkjxdgL30pC8tq3q0Fp3x8UTvmkQ7P5VII M9CMXkepnMZGg== Date: Wed, 12 Nov 2025 18:12:48 -0800 From: Jakub Kicinski To: Tariq Toukan Cc: Eric Dumazet , Paolo Abeni , Andrew Lunn , "David S. Miller" , Jiri Pirko , , , Mark Bloch , Gal Pressman , Leon Romanovsky , Cosmin Ratiu , Moshe Shemesh , Jiri Pirko , Carolina Jubran , Shay Drory Subject: Re: [PATCH net] devlink: rate: Unset parent pointer in devl_rate_nodes_destroy Message-ID: <20251112181248.190415f7@kernel.org> In-Reply-To: <1762863279-1092021-1-git-send-email-tariqt@nvidia.com> References: <1762863279-1092021-1-git-send-email-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 11 Nov 2025 14:14:39 +0200 Tariq Toukan wrote: > The function devl_rate_nodes_destroy is documented to "Unset parent for > all rate objects". However, it was only calling the driver-specific > `rate_leaf_parent_set` or `rate_node_parent_set` ops and decrementing > the parent's refcount, without actually setting the > `devlink_rate->parent` pointer to NULL. > > This leaves a dangling pointer in the `devlink_rate` struct, which is > inconsistent with the behavior of `devlink_nl_rate_parent_node_set`, > where the parent pointer is correctly cleared. > > This patch fixes the issue by explicitly setting `devlink_rate->parent` > to NULL after notifying the driver, thus fulfilling the function's > documented behavior for all rate objects. What is the _real_ issue you're solving here? If the function destroys all nodes maybe it doesn't matter that the pointer isn't cleared. -- pw-bot: cr