[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZQGhZcA1e7CjnL+P@lore-desk>
Date: Wed, 13 Sep 2023 13:47:49 +0200
From: Lorenzo Bianconi <lorenzo@...nel.org>
To: Simon Horman <horms@...nel.org>
Cc: netdev@...r.kernel.org, lorenzo.bianconi@...hat.com, nbd@....name,
john@...ozen.org, sean.wang@...iatek.com, Mark-MC.Lee@...iatek.com,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com
Subject: Re: [PATCH net-next] net: ethernet: mtk_wed: check
update_wo_rx_stats in mtk_wed_update_rx_stats()
> On Tue, Sep 12, 2023 at 10:28:00AM +0200, Lorenzo Bianconi wrote:
> > Check if update_wo_rx_stats function pointer is properly set in
> > mtk_wed_update_rx_stats routine before accessing it.
> >
> > Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.org>
>
> Hi Lorenzo,
Hi Simon,
>
> I'm a little curious about this.
>
> Is there a condition where it is not set but accessed,
> which would presumably be a bug that warrants a fixes tag and
> targeting at 'net'?
>
> Or can it not occur, in which case this check is perhaps not needed?
nope, so far Wireless Ethernet Dispatches (WED) is supported just by mt7915
that sets update_wo_rx_stats callback. Howerver, I am currently working on WED
support for mt7996 where we do not have this callback available at the moment.
Regards,
Lorenzo
>
> Or something else?
>
> > ---
> > drivers/net/ethernet/mediatek/mtk_wed_mcu.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
> > index 071ed3dea860..72bcdaed12a9 100644
> > --- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
> > +++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
> > @@ -68,6 +68,9 @@ mtk_wed_update_rx_stats(struct mtk_wed_device *wed, struct sk_buff *skb)
> > struct mtk_wed_wo_rx_stats *stats;
> > int i;
> >
> > + if (!wed->wlan.update_wo_rx_stats)
> > + return;
> > +
> > if (count * sizeof(*stats) > skb->len - sizeof(u32))
> > return;
> >
> > --
> > 2.41.0
> >
> >
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists