Fix a couple of panics when detaching from a cxgbe/cxl interface that was
never brought up: - Allow NULL to be passed to sglist_free(). - Don't try to stop an interface that was never fully initialized. Reviewed by: np
This commit is contained in:
parent
183b03c81c
commit
4f621933a5
@ -3292,6 +3292,12 @@ cxgbe_uninit_synchronized(struct port_info *pi)
|
||||
|
||||
ASSERT_SYNCHRONIZED_OP(sc);
|
||||
|
||||
if (!(pi->flags & PORT_INIT_DONE)) {
|
||||
KASSERT(!(ifp->if_drv_flags & IFF_DRV_RUNNING),
|
||||
("uninited port is running"));
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Disable the VI so that all its data in either direction is discarded
|
||||
* by the MPS. Leave everything else (the queues, interrupts, and 1Hz
|
||||
|
@ -216,6 +216,9 @@ void
|
||||
sglist_free(struct sglist *sg)
|
||||
{
|
||||
|
||||
if (sg == NULL)
|
||||
return;
|
||||
|
||||
if (refcount_release(&sg->sg_refs))
|
||||
free(sg, M_SGLIST);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user