busdma: Make sure bounce zone's sysctl tree is created before destroying it
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 31 Dec 2010 09:28:12 +0000 (17:28 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 8 Jan 2011 15:15:23 +0000 (23:15 +0800)
sys/platform/pc32/i386/busdma_machdep.c
sys/platform/pc64/x86_64/busdma_machdep.c

index b45e2d6..53d1f5e 100644 (file)
@@ -1281,7 +1281,8 @@ free_bounce_zone(bus_dma_tag_t dmat)
        free_bounce_pages_all(dmat);
        dmat->bounce_zone = NULL;
 
-       sysctl_ctx_free(&bz->sysctl_ctx);
+       if (bz->sysctl_tree != NULL)
+               sysctl_ctx_free(&bz->sysctl_ctx);
        kfree(bz, M_DEVBUF);
 }
 
index 473030d..a983646 100644 (file)
@@ -1281,7 +1281,8 @@ free_bounce_zone(bus_dma_tag_t dmat)
        free_bounce_pages_all(dmat);
        dmat->bounce_zone = NULL;
 
-       sysctl_ctx_free(&bz->sysctl_ctx);
+       if (bz->sysctl_tree != NULL)
+               sysctl_ctx_free(&bz->sysctl_ctx);
        kfree(bz, M_DEVBUF);
 }