git: 2a119886630b - main - altq: Stop checking for failures from malloc(M_WAITOK)

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Tue, 03 Sep 2024 10:26:48 UTC
The branch main has been updated by zlei:

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

commit 2a119886630bb5fe8283e20db5acb7c0cdba31c3
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2024-09-03 10:25:19 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2024-09-03 10:25:19 +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
---
 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;