From fa75c1cc242665d123ef5bf2f4ced2e076b35450 Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Mon, 15 Jun 2026 09:43:57 +0800 Subject: [PATCH] mwl: return ENOMEM when rx buffer allocation fails The malloc() failure path returned error, which is 0 at this point, so callers would treat the allocation failure as success. Return ENOMEM instead to correctly propagate the out-of-memory condition. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D42282 --- sys/dev/mwl/if_mwl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mwl/if_mwl.c b/sys/dev/mwl/if_mwl.c index 87e2679778d..3dc44ba20ee 100644 --- a/sys/dev/mwl/if_mwl.c +++ b/sys/dev/mwl/if_mwl.c @@ -2165,7 +2165,7 @@ mwl_rxdma_setup(struct mwl_softc *sc) bf = malloc(bsize, M_MWLDEV, M_NOWAIT | M_ZERO); if (bf == NULL) { device_printf(sc->sc_dev, "malloc of %u rx buffers failed\n", bsize); - return error; + return ENOMEM; } sc->sc_rxdma.dd_bufptr = bf;