aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-06-27 11:57:14 +0000
committerJason A. Donenfeld <Jason@zx2c4.com>2019-07-03 08:50:30 +0000
commit1d96af3b98501370a5b0efb3e7d57243a8dda8d2 (patch)
tree09615e2a7694924bc5d4f53b5c9946eba8500db1
parentUse synchronize_rcu()-like semantics for exclusive transition lock (diff)
downloadwintun-1d96af3b98501370a5b0efb3e7d57243a8dda8d2.tar.xz
wintun-1d96af3b98501370a5b0efb3e7d57243a8dda8d2.zip
Account for device removal before initialization
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--wintun.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/wintun.c b/wintun.c
index 26d2c1e..8db1924 100644
--- a/wintun.c
+++ b/wintun.c
@@ -1069,6 +1069,8 @@ TunDispatchPnP(DEVICE_OBJECT *DeviceObject, IRP *Irp)
{
#pragma warning(suppress : 28175)
TUN_CTX *ctx = DeviceObject->Reserved;
+ if (!ctx)
+ return NdisDispatchPnP(DeviceObject, Irp);
switch (stack->MinorFunction)
{