diff --git a/sys/cam/ctl/ctl_ha.c b/sys/cam/ctl/ctl_ha.c index 8e261de837f..572bdc40bad 100644 --- a/sys/cam/ctl/ctl_ha.c +++ b/sys/cam/ctl/ctl_ha.c @@ -196,10 +196,11 @@ ctl_ha_lclose(struct ha_softc *softc) { if (softc->ha_lso) { - SOCKBUF_LOCK(&softc->ha_lso->so_rcv); - if (softc->ha_lso->so_rcv.sb_upcall != NULL) - soupcall_clear(softc->ha_lso, SO_RCV); - SOCKBUF_UNLOCK(&softc->ha_lso->so_rcv); + if (SOLISTENING(softc->ha_lso)) { + SOLISTEN_LOCK(softc->ha_lso); + solisten_upcall_set(softc->ha_lso, NULL, NULL); + SOLISTEN_UNLOCK(softc->ha_lso); + } soclose(softc->ha_lso); softc->ha_lso = NULL; }