From e3a7c990ffb0f214be7a450ccbb1a0a2a9f616f2 Mon Sep 17 00:00:00 2001 From: Weongyo Jeong Date: Sat, 27 Dec 2008 09:42:17 +0000 Subject: [PATCH] fix a bug to handling the argument that it passed `device_t' but it's handled as `struct ndis_softc'. It'll cause a panic when the driver is detached. --- sys/compat/ndis/kern_ndis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c index 98ac5387f66c..e65734c96839 100644 --- a/sys/compat/ndis/kern_ndis.c +++ b/sys/compat/ndis/kern_ndis.c @@ -1205,11 +1205,13 @@ ndis_pnpevent_nic(arg, type) void *arg; int type; { + device_t dev; struct ndis_softc *sc; ndis_handle adapter; ndis_pnpevent_handler pnpeventfunc; - sc = arg; + dev = arg; + sc = device_get_softc(arg); NDIS_LOCK(sc); adapter = sc->ndis_block->nmb_miniportadapterctx; pnpeventfunc = sc->ndis_chars->nmc_pnpevent_handler;