mwl: return ENOMEM when rx buffer allocation fails
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / amd64 macos-latest (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 macos-latest (clang-18) (push) Waiting to run

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
This commit is contained in:
Kevin Lo
2026-06-15 09:43:57 +08:00
parent db887713de
commit fa75c1cc24
+1 -1
View File
@@ -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;