git: 7a720bf67d73 - main - xdr: Stop checking for failures from malloc(M_WAITOK)
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 03 Sep 2024 10:26:53 UTC
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7a720bf67d73ba565a0a1130065f798870eb5faa commit 7a720bf67d73ba565a0a1130065f798870eb5faa Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2024-09-03 10:25:20 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-09-03 10:25:20 +0000 xdr: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/xdr/xdr_sizeof.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/xdr/xdr_sizeof.c b/sys/xdr/xdr_sizeof.c index 6b4ee0352c9e..bcacf918f4fd 100644 --- a/sys/xdr/xdr_sizeof.c +++ b/sys/xdr/xdr_sizeof.c @@ -94,10 +94,7 @@ x_inline(XDR *xdrs, u_int len) /* Free the earlier space and allocate new area */ if (xdrs->x_private) free(xdrs->x_private, M_RPC); - if ((xdrs->x_private = (caddr_t) malloc(len, M_RPC, M_WAITOK)) == NULL) { - xdrs->x_base = 0; - return (NULL); - } + xdrs->x_private = malloc(len, M_RPC, M_WAITOK); xdrs->x_base = (caddr_t)(uintptr_t) len; xdrs->x_handy += len; return ((int32_t *) xdrs->x_private);