Re: [PATCH v2 1/2] wifi: b43: fix infinite loop from invalid hardware DMA RX slot

Michael Büsch <[email protected]> Thu, 16 Apr 2026 18:31:00 +0200
Newsgroups org.infradead.lists.b43-dev,org.kernel.vger.linux-kernel,org.kernel.vger.linux-wireless
Message-ID <20260416183100.154ca989@barney>
--===============4683018667449842658==
Content-Type: multipart/signed; boundary="Sig_/XcuoM4WBcXaryJQ/pBrWOW/";
 protocol="application/pgp-signature"; micalg=pgp-sha512

--Sig_/XcuoM4WBcXaryJQ/pBrWOW/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thu, 16 Apr 2026 08:34:00 +0200
Jonas Gorski <[email protected]> wrote:

> > diff --git a/drivers/net/wireless/broadcom/b43/dma.c b/drivers/net/wire=
less/broadcom/b43/dma.c
> > index XXXXXXX..XXXXXXX 100644
> > --- a/drivers/net/wireless/broadcom/b43/dma.c
> > +++ b/drivers/net/wireless/broadcom/b43/dma.c
> > @@ -1693,7 +1693,10 @@ void b43_dma_rx(struct b43_dmaring *ring)
> >         B43_WARN_ON(ring->tx);
> >         current_slot =3D ops->get_current_rxslot(ring);
> > -       B43_WARN_ON(!(current_slot >=3D 0 && current_slot < ring->nr_sl=
ots));
> > +       if (!(current_slot >=3D 0 && current_slot < ring->nr_slots)) {
> > +               B43_WARN_ON(1);
> > +               return;
> > +       } =20
>=20
> B43_WARN_ON() returns the condition's result, so you can shorten this to
>=20
> if (B43_WARN_ON(!(current_slot >=3D 0 && current_slot < ring->nr_slots)))
>         return;


Acked-by: Michael B=C3=BCsch <[email protected]>

Please also check the b43legacy driver. It may contain exactly the same cod=
e.

--=20
Michael B=C3=BCsch
https://bues.ch/

--Sig_/XcuoM4WBcXaryJQ/pBrWOW/
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEihRzkKVZOnT2ipsS9TK+HZCNiw4FAmnhDsQACgkQ9TK+HZCN
iw6mJA//Xnlm9AkM3Gk9OrGU02FsfwgrjG7JgULGL0H13Cua7z1s0YhDERMyxjmm
J6ridsu0twsw3IYW0ptzi/drM8cGLWTFdx3BANQFFUOOt06hSVU3h4wfgOCU5r7S
QuZUo6d33KB68mwX09Iw2TYBei3XEnafX5JuIS9u7mqffAuYLs4nyL2ulmQYoCfR
I47dOBdzpjH4kKGsrcJL0NWzilVp4uy8K+y41DhI/EYxHBn9HQYGKHMgxXIzj47L
mAMMiMQ0eiHer9OXyn8QJmXx4vz85dwMl7BRaVTf39j41SF4sO8jU+2R04xZQmCO
KgcmWCbtiu8CPBK9QMhBD2YmH8ng5DZGSuuE2GKVxl9orGKN4ONKWhayeaP8J8Yp
PRQLWd64GdzguWEYFIlmUYM6jniat6KXdPXZnbPEp6m+XjTM4ARrceXklf69Cndd
npYLD0hNpb2ZrzP6URMkaQv3IdtEdu7z8KdI42GiYcSj1qv7Q/uGLIAoilyB62cx
JgPrP3bgQ1u8T21eUrlxFqOsgz6pLrsCl/Rac8hiuFFxL0mcjgL1BSBv5w1E5a0w
VGR+NxRNLAqdcTv8WfyVyonc9rFBBxf82WmTRpeasPcn4VxRpM1SpgBev8lbJDoI
f1LNiiLH5I3qr9JDqJElxaJk5Ivwd1M3igAvGVzrOzCEP6O0D74=
=VKY1
-----END PGP SIGNATURE-----

--Sig_/XcuoM4WBcXaryJQ/pBrWOW/--


--===============4683018667449842658==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
b43-dev mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/b43-dev

--===============4683018667449842658==--