Unverified Commit 9147969b authored by Przemyslaw Lewandowski's avatar Przemyslaw Lewandowski Committed by Eric Joyner
Browse files

iflib: Add null check to iflib_stop()



Ever since gtaskqueue_drain() was added to iflib_stop(), a kernel panic
occurs when the ice(4) driver is in recovery mode. Queues are not
initialized in this mode, so gt_taskqueue is not initialized, and
gtaskqueue_drain() will panic.

Fix this by only doing a drain if an RX queue's gt_taskqueue is
initialized.

Signed-off-by: default avatarEric Joyner <erj@FreeBSD.org>

Reviewed by:	erj@
MFC after:	1 week
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D37892
parent 2508da22
......@@ -2644,8 +2644,9 @@ iflib_stop(if_ctx_t ctx)
bzero((void *)di->idi_vaddr, di->idi_size);
}
for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) {
gtaskqueue_drain(rxq->ifr_task.gt_taskqueue,
&rxq->ifr_task.gt_task);
if (rxq->ifr_task.gt_taskqueue != NULL)
gtaskqueue_drain(rxq->ifr_task.gt_taskqueue,
&rxq->ifr_task.gt_task);
rxq->ifr_cq_cidx = 0;
for (j = 0, di = rxq->ifr_ifdi; j < sctx->isc_nrxqs; j++, di++)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment