Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Sep 2024 05:07:58 GMT
From:      Zhenlei Huang <zlei@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: ca22505a15a7 - stable/13 - kern_fail: Stop checking for failures from fp_malloc(M_WAITOK)
Message-ID:  <202409300507.48U57wtA023935@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=ca22505a15a7c1638b6666c4d2858c36d1849939

commit ca22505a15a7c1638b6666c4d2858c36d1849939
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2024-09-03 10:25:16 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2024-09-30 05:05:28 +0000

    kern_fail: Stop checking for failures from fp_malloc(M_WAITOK)
    
    `fp_malloc` is defined as a macro that redirects to `malloc`.
    
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D45852
    
    (cherry picked from commit 6a2a385507c79abaa9db9eabfdd827362f3dc7ed)
    (cherry picked from commit fbaf4806511522cdcac7eda3bd5fbcc4b2e2f15c)
---
 sys/kern/kern_fail.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/sys/kern/kern_fail.c b/sys/kern/kern_fail.c
index f60500b22ef4..2c362b68f24b 100644
--- a/sys/kern/kern_fail.c
+++ b/sys/kern/kern_fail.c
@@ -479,11 +479,10 @@ fail_point_init(struct fail_point *fp, const char *fmt, ...)
 
 	/* Allocate the name and fill it in. */
 	name = fp_malloc(n + 1, M_WAITOK);
-	if (name != NULL) {
-		va_start(ap, fmt);
-		vsnprintf(name, n + 1, fmt, ap);
-		va_end(ap);
-	}
+	va_start(ap, fmt);
+	vsnprintf(name, n + 1, fmt, ap);
+	va_end(ap);
+
 	fp->fp_name = name;
 	fp->fp_location = "";
 	fp->fp_flags |= FAIL_POINT_DYNAMIC_NAME;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202409300507.48U57wtA023935>