Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Dec 2008 09:42:17 +0000 (UTC)
From:      Weongyo Jeong <weongyo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r186509 - head/sys/compat/ndis
Message-ID:  <200812270942.mBR9gHBd066285@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: weongyo
Date: Sat Dec 27 09:42:17 2008
New Revision: 186509
URL: http://svn.freebsd.org/changeset/base/186509

Log:
  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.

Modified:
  head/sys/compat/ndis/kern_ndis.c

Modified: head/sys/compat/ndis/kern_ndis.c
==============================================================================
--- head/sys/compat/ndis/kern_ndis.c	Sat Dec 27 09:36:22 2008	(r186508)
+++ head/sys/compat/ndis/kern_ndis.c	Sat Dec 27 09:42:17 2008	(r186509)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812270942.mBR9gHBd066285>