cxgbe(4): Avoid a NULL dereference that would occur during module unload

if there were problems earlier during attach.

MFC after:	3 days
Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2017-08-06 19:45:59 +00:00
parent 0b9b3897a8
commit cc2050c5eb

View file

@ -382,8 +382,10 @@ t4_free_tx_sched(struct adapter *sc)
taskqueue_drain(taskqueue_thread, &sc->tc_task);
for_each_port(sc, i)
free(sc->port[i]->sched_params, M_CXGBE);
for_each_port(sc, i) {
if (sc->port[i] != NULL)
free(sc->port[i]->sched_params, M_CXGBE);
}
if (mtx_initialized(&sc->tc_lock))
mtx_destroy(&sc->tc_lock);