[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <41e1f541-ef92-40ad-ab4d-263303479959@web.de>
Date: Fri, 20 Dec 2024 12:10:14 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Peilin He <he.peilin@....com.cn>, Kun Jiang <jiang.kun2@....com.cn>,
xu xin <xu.xin16@....com.cn>, netdev@...r.kernel.org,
Andrew Lunn <andrew@...n.ch>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Vladimir Oltean <olteanv@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>, Fan Yu <fan.yu9@....com.cn>,
tu.qiang35@....com.cn, yang.yang29@....com.cn,
Yaxin Wang <wang.yaxin@....com.cn>, ye xingchen <ye.xingchen@....com.cn>,
Yunkai Zhang <zhang.yunkai@....com.cn>, Yutan Qiu <qiu.yutan@....com.cn>
Subject: Re: [PATCH linux next] net: dsa: fix the dsa_ptr null pointer
dereference
…
> +++ b/net/dsa/dsa.c
> @@ -1561,6 +1561,17 @@ void dsa_unregister_switch(struct dsa_switch *ds)
> }
> EXPORT_SYMBOL_GPL(dsa_unregister_switch);
>
> +static void dsa_conduit_ethtool_shutdown(struct net_device *dev)
> +{
> + struct dsa_port *cpu_dp = dev->dsa_ptr;
I suggest to assign this local variable only after the subsequent check.
> +
> + if (netif_is_lag_master(dev))
> + return;
> +
> + dev->ethtool_ops = cpu_dp->orig_ethtool_ops;
> + cpu_dp->orig_ethtool_ops = NULL;
> +}
…
Regards,
Markus
Powered by blists - more mailing lists