git: 891fdd020a68 - stable/14 - altq: Stop checking for failures from malloc(M_WAITOK)

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Mon, 30 Sep 2024 04:45:09 UTC
The branch stable/14 has been updated by zlei:

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

commit 891fdd020a6826eb98d30284f78000e666f9a263
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2024-09-03 10:25:19 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2024-09-30 04:44:15 +0000

    altq: Stop checking for failures from malloc(M_WAITOK)
    
    While here, prefer malloc(M_ZERO) over bzero().
    
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D45852
    
    (cherry picked from commit 2a119886630bb5fe8283e20db5acb7c0cdba31c3)
---
 sys/net/altq/altq_subr.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/sys/net/altq/altq_subr.c b/sys/net/altq/altq_subr.c
index 3ade724818dd..534841289611 100644
--- a/sys/net/altq/altq_subr.c
+++ b/sys/net/altq/altq_subr.c
@@ -1327,12 +1327,7 @@ acc_add_filter(classifier, filter, class, phandle)
 		return (EINVAL);
 #endif
 
-	afp = malloc(sizeof(struct acc_filter),
-	       M_DEVBUF, M_WAITOK);
-	if (afp == NULL)
-		return (ENOMEM);
-	bzero(afp, sizeof(struct acc_filter));
-
+	afp = malloc(sizeof(*afp), M_DEVBUF, M_WAITOK | M_ZERO);
 	afp->f_filter = *filter;
 	afp->f_class = class;