cam: Assert we have a reference when freeing sim
Before we decrement refcount to sleep on the sim, assert that the refcount >= 1. If it were 0 here, we'd never wake up.
This commit is contained in:
parent
6debfd4b13
commit
a1975719dd
@ -134,6 +134,7 @@ cam_sim_free(struct cam_sim *sim, int free_devq)
|
||||
mtx = sim->mtx;
|
||||
mtx_assert(mtx, MA_OWNED);
|
||||
}
|
||||
KASSERT(sim->refcount >= 1, ("sim->refcount >= 1"));
|
||||
sim->refcount--;
|
||||
if (sim->refcount > 0) {
|
||||
error = msleep(sim, mtx, PRIBIO, "simfree", 0);
|
||||
|
Loading…
Reference in New Issue
Block a user