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 67FF1C2BB3F for ; Wed, 15 Nov 2023 18:11:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229497AbjKOSLR (ORCPT ); Wed, 15 Nov 2023 13:11:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbjKOSLN (ORCPT ); Wed, 15 Nov 2023 13:11:13 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AED0189 for ; Wed, 15 Nov 2023 10:11:10 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8C6DC433C8; Wed, 15 Nov 2023 18:11:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700071869; bh=SKHJUnjpmtws/NFQEUU8h0axwxdCJ+qDn5qwpISmjaE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B3tI/qlm/C+qfBnlLtg6SZPP5DLP4rSGWgurWELIrMiG19l7q++pccC9aWKHgj8cS Hdfyy4MNLvo0XObCme76nhVjlJI4vE2KKy/ayieP2kyOUEDyB/W/NibM+FcqRqAeMO HdfiWKJbbNwJsPVlUN+P3kA8s/VKjWAdEi69F43a+7ILUC3KvH8FdLwixJYVzqnRH9 RSTNQrMDaXIkLjwAY7JMUVvkbJXIU7XDbdfus7fgw2FKeo7KmWaSGk3UqBIsr5dO46 LtlXDsb/K+FtJ/uvoYy4OEhpEQm8FVvTbVnGM6TzuE6HU9v6KmctbFqU3OOTX1qbCV d31m/mDaf/QmA== Date: Wed, 15 Nov 2023 18:11:03 +0000 From: Simon Horman To: Romain Gantois Cc: davem@davemloft.net, Rob Herring , Krzysztof Kozlowski , Jakub Kicinski , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Vladimir Oltean , Luka Perkov , Robert Marko , Andy Gross , Bjorn Andersson , Konrad Dybcio Subject: Re: [PATCH net-next v3 3/8] net: qualcomm: ipqess: introduce the Qualcomm IPQESS driver Message-ID: <20231115181103.GX74656@kernel.org> References: <20231114105600.1012056-1-romain.gantois@bootlin.com> <20231114105600.1012056-4-romain.gantois@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231114105600.1012056-4-romain.gantois@bootlin.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 14, 2023 at 11:55:53AM +0100, Romain Gantois wrote: > The Qualcomm IPQ4019 Ethernet Switch Subsystem for the IPQ4019 chip > includes an internal Ethernet switch based on the QCA8K IP. > > The CPU-to-switch port data plane depends on the IPQESS EDMA Controller, > a simple 1G Ethernet controller. It is connected to the switch through an > internal link, and doesn't expose directly any external interface. > > The EDMA controller has 16 RX and TX queues, with a very basic RSS fanout > configured at init time. > > Signed-off-by: Romain Gantois Hi Romain, some minor feedback from my side. > diff --git a/drivers/net/ethernet/qualcomm/ipqess/ipqess_switch.c b/drivers/net/ethernet/qualcomm/ipqess/ipqess_switch.c ... > +static int ipqess_switch_probe(struct platform_device *pdev) > +{ ... > + for_each_available_child_of_node(ports, port_np) { > + ret = ipqess_port_register(sw, port_np); > + if (ret) { > + pr_err("Failed to register ipqess port! error %d\n", ret); Coccinelle warns that a call to of_node_put() is needed here. > + goto out_ports; > + } > + } ... > +static int > +ipqess_switch_remove(struct platform_device *pdev) > +{ > + struct ipqess_switch *sw = platform_get_drvdata(pdev); > + struct qca8k_priv *priv = sw->priv; Here sw is dereferenced... > + struct ipqess_port *port = NULL; > + int i; > + > + if (!sw) > + return 0; ... but here the code guards against sw being NULL. This seems inconsistent. As flagged by Smatch. ...