cxgbe(4): Do not try to use 0 as an rx buffer address when the driver is

already allocating from the safe zone and the allocation fails.

This bug was introduced in r357481.

MFC after:	3 days
Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2020-03-10 21:44:20 +00:00
parent 8149b12da1
commit 2b9010f070

View File

@ -4382,10 +4382,12 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n)
MPASS(sd->cl == NULL);
rxb = &sc->sge.rx_buf_info[fl->zidx];
cl = uma_zalloc(rxb->zone, M_NOWAIT);
if (__predict_false(cl == NULL) && fl->zidx != fl->safe_zidx) {
rxb = &sc->sge.rx_buf_info[fl->safe_zidx];
cl = uma_zalloc(rxb->zone, M_NOWAIT);
if (__predict_false(cl == NULL))
if (__predict_false(cl == NULL)) {
if (fl->zidx != fl->safe_zidx) {
rxb = &sc->sge.rx_buf_info[fl->safe_zidx];
cl = uma_zalloc(rxb->zone, M_NOWAIT);
}
if (cl == NULL)
break;
}
fl->cl_allocated++;