From 2a119886630bb5fe8283e20db5acb7c0cdba31c3 Mon Sep 17 00:00:00 2001 From: Zhenlei Huang Date: Tue, 3 Sep 2024 18:25:19 +0800 Subject: [PATCH] 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;