[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8b342640-f4e7-45a1-a6d4-471e687bbbc7@stanley.mountain>
Date: Sat, 22 Mar 2025 13:19:42 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Markus Elfring <Markus.Elfring@....de>
Cc: Qasim Ijaz <qasdev00@...il.com>, linux-wireless@...r.kernel.org,
linux-mediatek@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
LKML <linux-kernel@...r.kernel.org>,
Angelo Gioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Bo Jiao <bo.jiao@...iatek.com>, Felix Fietkau <nbd@....name>,
Lorenzo Bianconi <lorenzo@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Peter Chiu <chui-hao.chiu@...iatek.com>,
Ryder Lee <ryder.lee@...iatek.com>,
Sean Wang <sean.wang@...iatek.com>,
Shayne Chen <shayne.chen@...iatek.com>
Subject: Re: [PATCH] wifi: mt76: mt7996: prevent uninit return in
mt7996_mac_sta_add_links
On Sat, Mar 22, 2025 at 11:01:18AM +0100, Markus Elfring wrote:
> …
> > +++ 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;
> >
> > link_conf = link_conf_dereference_protected(vif, link_id);
> > - if (!link_conf)
> > + if (!link_conf) {
> > + err = -EINVAL;
> > goto error_unlink;
> > + }
> >
> > link = mt7996_vif_link(dev, vif, link_id);
> > - if (!link)
> > + if (!link) {
> > + err = -EINVAL;
> > goto error_unlink;
> > + }
> …
>
> I suggest to avoid such repeated error code assignments.
> Can an additional label be applied instead for this purpose?
Maintainers get the final vote but generally when someone is doing
the work they get to decide.
I would say that generally the way that Qasim did it is normally
more readable and more future proof.
regards
dan carpenter
Powered by blists - more mailing lists