From 4a6f6562e4a18d08e5b76560c66f8790a550b2ee Mon Sep 17 00:00:00 2001 From: weongyo Date: Sat, 27 Dec 2008 09:42:17 +0000 Subject: 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(-) (limited to 'sys/compat') diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c index 98ac538..e65734c 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; -- cgit v1.1