Date: Mon, 15 Jun 2026 01:47:09 +0000 From: Kevin Lo <kevlo@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: fa75c1cc2426 - main - mwl: return ENOMEM when rx buffer allocation fails Message-ID: <6a2f599d.264d7.1185c1d0@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by kevlo: URL: https://cgit.FreeBSD.org/src/commit/?id=fa75c1cc242665d123ef5bf2f4ced2e076b35450 commit fa75c1cc242665d123ef5bf2f4ced2e076b35450 Author: Kevin Lo <kevlo@FreeBSD.org> AuthorDate: 2026-06-15 01:43:57 +0000 Commit: Kevin Lo <kevlo@FreeBSD.org> CommitDate: 2026-06-15 01:43:57 +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 --- 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 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;home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a2f599d.264d7.1185c1d0>
