git: 4ab772166ebe - stable/15 - mwl: return ENOMEM when rx buffer allocation fails

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Fri, 30 Oct 2026 17:38:59 UTC
The branch stable/15 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=4ab772166ebea004bee73c84b6252241d68e48ce

commit 4ab772166ebea004bee73c84b6252241d68e48ce
Author:     Kevin Lo <kevlo@FreeBSD.org>
AuthorDate: 2026-06-15 01:43:57 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-10-30 17:37:59 +0000

    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
    
    (cherry picked from commit fa75c1cc242665d123ef5bf2f4ced2e076b35450)
---
 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 279d4e13c27d..c51b3a5fef2e 100644
--- a/sys/dev/mwl/if_mwl.c
+++ b/sys/dev/mwl/if_mwl.c
@@ -2153,7 +2153,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;