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
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user