[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZCr1LXCiaJoImjmJ@corigine.com>
Date: Mon, 3 Apr 2023 17:47:57 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Cc: Vinod Koul <vkoul@...nel.org>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Bhupesh Sharma <bhupesh.sharma@...aro.org>,
netdev@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, kernel@...gutronix.de
Subject: Re: [PATCH net-next 03/11] net: stmmac: dwmac-qcom-ethqos: Drop an
if with an always false condition
On Sun, Apr 02, 2023 at 04:30:17PM +0200, Uwe Kleine-König wrote:
> The remove callback is only ever called after .probe() returned
> successfully. After that get_stmmac_bsp_priv() always return non-NULL.
>
> Side note: The early exit would also be a bug because the return value
> of qcom_ethqos_remove() is ignored by the device core and the device is
> unbound unconditionally. So exiting early resulted in a dangerous
> resource leak as all devm allocated resources (some memory and the
> register mappings) are freed but the network device stays around. Using
> the network device afterwards probably oopses.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Reviewed-by: Simon Horman <simon.horman@...igine.com>
Powered by blists - more mailing lists