[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <356de8c6-b3a2-4f7c-9737-011a91c4bdfd@stanley.mountain>
Date: Fri, 21 Mar 2025 20:35:25 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Lorenzo Bianconi <lorenzo@...nel.org>
Cc: Qasim Ijaz <qasdev00@...il.com>, nbd@....name, ryder.lee@...iatek.com,
shayne.chen@...iatek.com, sean.wang@...iatek.com,
matthias.bgg@...il.com, angelogioacchino.delregno@...labora.com,
chui-hao.chiu@...iatek.com, Bo.Jiao@...iatek.com,
linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] wifi: mt76: mt7996: prevent uninit return in
mt7996_mac_sta_add_links
On Fri, Mar 21, 2025 at 06:14:49PM +0100, Lorenzo Bianconi wrote:
> > On Thu, Mar 20, 2025 at 08:19:14PM +0000, Qasim Ijaz wrote:
> > > If link_conf_dereference_protected() or mt7996_vif_link()
> > > or link_sta_dereference_protected() fail the code jumps to
> > > the error_unlink label and returns ret which is uninitialised.
> > >
> > > Fix this by setting err before jumping to error_unlink.
> > >
> > > Fixes: c7e4fc362443 ("wifi: mt76: mt7996: Update mt7996_mcu_add_sta to MLO support")
> > > Fixes: dd82a9e02c05 ("wifi: mt76: mt7996: Rely on mt7996_sta_link in sta_add/sta_remove callbacks")
> > > Signed-off-by: Qasim Ijaz <qasdev00@...il.com>
> > > ---
> > > drivers/net/wireless/mediatek/mt76/mt7996/main.c | 12 +++++++++---
> > > 1 file changed, 9 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/main.c b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
> > > index 91c64e3a0860..78f7f1fc867e 100644
> > > --- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c
> > > +++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
> > > @@ -998,16 +998,22 @@ mt7996_mac_sta_add_links(struct mt7996_dev *dev, struct ieee80211_vif *vif,
> > > continue;
> >
> > What about if the list is empty or we hit this continue on every link?
>
> we will return 0 and I guess that's fine, agree?
>
Fine by me?
regards,
dan carpenter
Powered by blists - more mailing lists