Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102678575
D47365.id145839.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D47365.id145839.diff
View Options
diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c
--- a/sys/dev/msk/if_msk.c
+++ b/sys/dev/msk/if_msk.c
@@ -252,6 +252,7 @@
static int mskc_probe(device_t);
static int mskc_attach(device_t);
+static void mskc_child_deleted(device_t, device_t);
static int mskc_detach(device_t);
static int mskc_shutdown(device_t);
static int mskc_setup_rambuffer(struct msk_softc *);
@@ -335,6 +336,7 @@
DEVMETHOD(device_resume, mskc_resume),
DEVMETHOD(device_shutdown, mskc_shutdown),
+ DEVMETHOD(bus_child_deleted, mskc_child_deleted),
DEVMETHOD(bus_get_dma_tag, mskc_get_dma_tag),
DEVMETHOD_END
@@ -2046,6 +2048,12 @@
return (0);
}
+static void
+mskc_child_deleted(device_t dev, device_t child)
+{
+ free(device_get_ivars(child), M_DEVBUF);
+}
+
static int
mskc_detach(device_t dev)
{
@@ -2056,13 +2064,9 @@
if (device_is_alive(dev)) {
if (sc->msk_devs[MSK_PORT_A] != NULL) {
- free(device_get_ivars(sc->msk_devs[MSK_PORT_A]),
- M_DEVBUF);
device_delete_child(dev, sc->msk_devs[MSK_PORT_A]);
}
if (sc->msk_devs[MSK_PORT_B] != NULL) {
- free(device_get_ivars(sc->msk_devs[MSK_PORT_B]),
- M_DEVBUF);
device_delete_child(dev, sc->msk_devs[MSK_PORT_B]);
}
bus_generic_detach(dev);
diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c
--- a/sys/dev/sk/if_sk.c
+++ b/sys/dev/sk/if_sk.c
@@ -185,6 +185,7 @@
static int skc_probe(device_t);
static int skc_attach(device_t);
+static void skc_child_deleted(device_t, device_t);
static int skc_detach(device_t);
static int skc_shutdown(device_t);
static int skc_suspend(device_t);
@@ -291,6 +292,7 @@
DEVMETHOD(device_resume, skc_resume),
DEVMETHOD(device_shutdown, skc_shutdown),
+ DEVMETHOD(bus_child_deleted, skc_child_deleted),
DEVMETHOD(bus_get_dma_tag, skc_get_dma_tag),
DEVMETHOD_END
@@ -1738,6 +1740,12 @@
return(error);
}
+static void
+skc_child_deleted(device_t dev, device_t child)
+{
+ free(device_get_ivars(child), M_DEVBUF);
+}
+
/*
* Shutdown hardware and free up resources. This can be called any
* time after the mutex has been initialized. It is called in both
@@ -1796,11 +1804,9 @@
if (device_is_alive(dev)) {
if (sc->sk_devs[SK_PORT_A] != NULL) {
- free(device_get_ivars(sc->sk_devs[SK_PORT_A]), M_DEVBUF);
device_delete_child(dev, sc->sk_devs[SK_PORT_A]);
}
if (sc->sk_devs[SK_PORT_B] != NULL) {
- free(device_get_ivars(sc->sk_devs[SK_PORT_B]), M_DEVBUF);
device_delete_child(dev, sc->sk_devs[SK_PORT_B]);
}
bus_generic_detach(dev);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 6:22 PM (3 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14662722
Default Alt Text
D47365.id145839.diff (2 KB)
Attached To
Mode
D47365: msk/sk: Use a bus_child_deleted method to free ivars for children
Attached
Detach File
Event Timeline
Log In to Comment