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
This commit is contained in:
Zhenlei Huang 2024-09-03 18:25:19 +08:00
parent 3feb35dc46
commit 2a11988663

View File

@ -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;