Convert more M_WAITOK malloc() to M_NOWAIT.
Reported by: Kim Culhan <w8hdkim gmail.com>
This commit is contained in:
parent
901610f4b8
commit
03fb709e1f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=240824
@ -362,7 +362,8 @@ priq_class_create(struct priq_if *pif, int pri, int qlimit, int flags, int qid)
|
||||
if (flags & PRCF_RIO) {
|
||||
cl->cl_red = (red_t *)rio_alloc(0, NULL,
|
||||
red_flags, red_pkttime);
|
||||
if (cl->cl_red != NULL)
|
||||
if (cl->cl_red == NULL)
|
||||
goto err_ret;
|
||||
qtype(cl->cl_q) = Q_RIO;
|
||||
} else
|
||||
#endif
|
||||
@ -371,7 +372,8 @@ priq_class_create(struct priq_if *pif, int pri, int qlimit, int flags, int qid)
|
||||
qlimit(cl->cl_q) * 10/100,
|
||||
qlimit(cl->cl_q) * 30/100,
|
||||
red_flags, red_pkttime);
|
||||
if (cl->cl_red != NULL)
|
||||
if (cl->cl_red == NULL)
|
||||
goto err_ret;
|
||||
qtype(cl->cl_q) = Q_RED;
|
||||
}
|
||||
}
|
||||
|
@ -231,10 +231,9 @@ red_alloc(int weight, int inv_pmax, int th_min, int th_max, int flags,
|
||||
int w, i;
|
||||
int npkts_per_sec;
|
||||
|
||||
rp = malloc(sizeof(red_t), M_DEVBUF, M_WAITOK);
|
||||
rp = malloc(sizeof(red_t), M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
if (rp == NULL)
|
||||
return (NULL);
|
||||
bzero(rp, sizeof(red_t));
|
||||
|
||||
rp->red_avg = 0;
|
||||
rp->red_idle = 1;
|
||||
|
@ -204,10 +204,9 @@ rio_alloc(int weight, struct redparams *params, int flags, int pkttime)
|
||||
int w, i;
|
||||
int npkts_per_sec;
|
||||
|
||||
rp = malloc(sizeof(rio_t), M_DEVBUF, M_WAITOK);
|
||||
rp = malloc(sizeof(rio_t), M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
if (rp == NULL)
|
||||
return (NULL);
|
||||
bzero(rp, sizeof(rio_t));
|
||||
|
||||
rp->rio_flags = flags;
|
||||
if (pkttime == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user