Subject: Re: [PATCH net-next v1 1/1] mlxbf_gige: Fix kernel panic at shutdown

From: Jakub Kicinski <[email-masked]>
Date: Tue, 6 Jun 2023 10:29:21 -0700

On Tue, 06 Jun 2023 12:47:09 +0200 Paolo Abeni wrote:
> >  static void mlxbf_gige_shutdown(struct platform_device *pdev)
> >  {
> > -	struct mlxbf_gige *priv = platform_get_drvdata(pdev);
> > -
> > -	writeq(0, priv->base + MLXBF_GIGE_INT_EN);
> > -	mlxbf_gige_clean_port(priv);
> > +	mlxbf_gige_remove(pdev);
> >  }
> >  
> >  static const struct acpi_device_id __maybe_unused mlxbf_gige_acpi_match[] = {  
> 
> if the device goes through both shutdown() and remove(), the netdevice
> will go through unregister_netdevice() 2 times, which is wrong. Am I
> missing something relevant?

Good point, mlxbf_gige_remove() needs to check that the priv pointer
is not NULL.
-- 
pw-bot: cr