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

From: Michael Büsch

Date: Thu Apr 16 2026 - 12:40:06 EST


On Thu, 16 Apr 2026 08:34:00 +0200
Jonas Gorski <jonas.gorski@xxxxxxxxx> wrote:

> > diff --git a/drivers/net/wireless/broadcom/b43/dma.c b/drivers/net/wireless/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 = ops->get_current_rxslot(ring);
> > - B43_WARN_ON(!(current_slot >= 0 && current_slot < ring->nr_slots));
> > + if (!(current_slot >= 0 && current_slot < ring->nr_slots)) {
> > + B43_WARN_ON(1);
> > + return;
> > + }
>
> B43_WARN_ON() returns the condition's result, so you can shorten this to
>
> if (B43_WARN_ON(!(current_slot >= 0 && current_slot < ring->nr_slots)))
> return;


Acked-by: Michael Büsch <m@xxxxxxx>

Please also check the b43legacy driver. It may contain exactly the same code.

--
Michael Büsch
https://bues.ch/

Attachment: pgpxfyYQr6xVy.pgp
Description: OpenPGP digital signature