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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5CB0AC4345F for ; Fri, 12 Apr 2024 13:03:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-ID:Date:To:Cc:From:Subject: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=i51QN7U2Z4epfLeMIfzsRArsJsRV+9U6vnkQ6iOCIyE=; b=iZwCS1MLj33at0 Omy9ELlDEur+i5y3uNEm/EX5auEb6OngCQ8LsVcZvroRrmNpYykIDbv/XD4reqcKDbv7OAOTzVeHk 6CxqCp/IkgxXQ/cOPg8Y06nJ5D1vEA+Qddkro5VHU13v3VBtHHOqUJeu3493iNQvbMPAhtwL48STa T2//ejh1e647/5/He2mNyeTkzL/dE7KiO78mK68Vk1T2fugigAKUXs31ZGaRPW5xRn45Gm1pQGmOw 9cRN1YCJJx4BCWyEDCI1BP8KVXqv/MXwpInmkZ9sPvS3MRn302gkF5qZLCcpEZhVoclqZivY0FKzy JFWvfgXRzml1YDrXHHAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvGYv-0000000HDBu-325B; Fri, 12 Apr 2024 13:03:25 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvGYp-0000000HD9J-00RM for linux-arm-kernel@lists.infradead.org; Fri, 12 Apr 2024 13:03:24 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id DFF096224E; Fri, 12 Apr 2024 13:03:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F856C113CC; Fri, 12 Apr 2024 13:03:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712926993; bh=8wdevPfrdtepk0PCtS0tbraBxnU6ILXWXbU+kfU/aQ0=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=awI6En4BnoNZRKhvZawTzXVzsV/D37RfCZWVwb0jDF/U9AMWf1YFeiczSz5Lh/Zl5 V3fWdznlkQSyZeB8AvsmqDewwWXIISMDenlbET0aoLX2zzeWeA1PfTKYh6lcdb/JYi G4UpelDztrOemmvQ+mbH/FjKboE/JfPRBfECavtTL38QibxOLqZMQ40NGUJosK3A8h 1Yy4pXxHAZB9xUayJCyeomyRO8ibLsjrfF2zljJAzqbgAmLDNym2vqjZKxkWBDA0dq f4rmv3QdM/IFJc2wY++J8r+a2bMBhMAcOhnCfLOBzxSvC2R5XTneHc9YLqLNS7XoQO akY2/Eo0aHpRg== MIME-Version: 1.0 In-Reply-To: <20240412104615.3779632-1-maxime.chevallier@bootlin.com> References: <20240412104615.3779632-1-maxime.chevallier@bootlin.com> Subject: Re: [PATCH net-next] net: phy: phy_link_topology: Handle NULL topologies From: Antoine Tenart Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?utf-8?q?K=C3=B6ry?= Maincent , Jesse Brandeburg , Marek =?utf-8?q?Beh=C3=BAn?= , Piergiorgio Beruto , Oleksij Rempel , =?utf-8?q?Nicol=C3=B2?= Veronese , Simon Horman , mwojtas@chromium.org, Nathan Chancellor To: Maxime Chevallier , davem@davemloft.net Date: Fri, 12 Apr 2024 15:03:10 +0200 Message-ID: <171292699033.4917.4025686054785818967@kwain> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240412_060319_187168_1DBEEAE3 X-CRM114-Status: GOOD ( 12.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Maxime, Quoting Maxime Chevallier (2024-04-12 12:46:14) > > This patch fixes a commit that is in net-next, hence the net-next tag and the > lack of "Fixes" tag. You can use Fixes: on net-next, that still helps to identify which commit is being fixed (eg. for reviews, while looking at the history, etc). > diff --git a/drivers/net/phy/phy_link_topology.c b/drivers/net/phy/phy_link_topology.c > index 985941c5c558..0f3973f07fac 100644 > --- a/drivers/net/phy/phy_link_topology.c > +++ b/drivers/net/phy/phy_link_topology.c > @@ -42,6 +42,9 @@ int phy_link_topo_add_phy(struct phy_link_topology *topo, > struct phy_device_node *pdn; > int ret; > > + if (!topo) > + return 0; > + With that phy_sfp_connect_phy does not need to check the topo validity before calling phy_link_topo_add_phy. The other way around is fine too. > @@ -93,7 +96,12 @@ EXPORT_SYMBOL_GPL(phy_link_topo_add_phy); > void phy_link_topo_del_phy(struct phy_link_topology *topo, > struct phy_device *phy) > { > - struct phy_device_node *pdn = xa_erase(&topo->phys, phy->phyindex); > + struct phy_device_node *pdn; > + > + if (!topo) > + return; > + > + pdn = xa_erase(&topo->phys, phy->phyindex); Same here with phy_sfp_disconnect_phy. Thanks! Antoine _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel