diff options
| author | Kevin Lo <kevlo@FreeBSD.org> | 2026-06-15 01:43:57 +0000 |
|---|---|---|
| committer | Kevin Lo <kevlo@FreeBSD.org> | 2026-06-15 01:43:57 +0000 |
| commit | fa75c1cc242665d123ef5bf2f4ced2e076b35450 (patch) | |
| tree | b4b69bbae045c70968abac1f9426404b10c54dfd | |
| parent | db887713de2bf5c77494220a9e0ddfa7d4290155 (diff) | |
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
| -rw-r--r-- | sys/dev/mwl/if_mwl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/mwl/if_mwl.c b/sys/dev/mwl/if_mwl.c index 87e2679778db..3dc44ba20ee4 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; |
