diff --git a/sys/dev/ow/ow.c b/sys/dev/ow/ow.c --- a/sys/dev/ow/ow.c +++ b/sys/dev/ow/ow.c @@ -330,6 +330,12 @@ return (0); } +static void +ow_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_OW); +} + static device_t ow_child_by_romid(device_t dev, romid_t romid) { @@ -560,7 +566,6 @@ { device_t *children, child; int nkid, i; - struct ow_devinfo *di; struct ow_softc *sc; sc = device_get_softc(ndev); @@ -577,8 +582,6 @@ return ENOMEM; for (i = 0; i < nkid; i++) { child = children[i]; - di = device_get_ivars(child); - free(di, M_OW); device_delete_child(ndev, child); } free(children, M_TEMP); @@ -703,6 +706,7 @@ DEVMETHOD(device_detach, ow_detach), /* Bus interface */ + DEVMETHOD(bus_child_deleted, ow_child_deleted), DEVMETHOD(bus_child_pnpinfo, ow_child_pnpinfo), DEVMETHOD(bus_read_ivar, ow_read_ivar), DEVMETHOD(bus_write_ivar, ow_write_ivar),