Make sure we don't dereference a null pointer
This commit is contained in:
parent
9b1cb34ced
commit
82242c11a6
@ -1753,8 +1753,12 @@ re_detach(device_t dev)
|
||||
bus_teardown_intr(dev, sc->rl_irq[0], sc->rl_intrhand[0]);
|
||||
sc->rl_intrhand[0] = NULL;
|
||||
}
|
||||
if (ifp != NULL)
|
||||
if (ifp != NULL) {
|
||||
#ifdef DEV_NETMAP
|
||||
netmap_detach(ifp);
|
||||
#endif /* DEV_NETMAP */
|
||||
if_free(ifp);
|
||||
}
|
||||
if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0)
|
||||
rid = 0;
|
||||
else
|
||||
@ -1843,9 +1847,6 @@ re_detach(device_t dev)
|
||||
bus_dma_tag_destroy(sc->rl_ldata.rl_stag);
|
||||
}
|
||||
|
||||
#ifdef DEV_NETMAP
|
||||
netmap_detach(ifp);
|
||||
#endif /* DEV_NETMAP */
|
||||
if (sc->rl_parent_tag)
|
||||
bus_dma_tag_destroy(sc->rl_parent_tag);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user