From: Paul Durrant Date: Tue, 13 Aug 2013 09:15:11 +0000 (+0100) Subject: Ignore attempts to remove device usage types that were not added. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2b92357435a05657677679c633b75a963e284927;p=people%2Fpauldu%2Fxenbus.git Ignore attempts to remove device usage types that were not added. ASSERTing on this condition is not particularly helpful as other buggy software causes BSODs. We should be able to safely ignore and succeed such IRPs. Signed-off-by: Paul Durrant --- diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c index f6ae1f1..2805d85 100644 --- a/src/xenbus/fdo.c +++ b/src/xenbus/fdo.c @@ -2539,12 +2539,12 @@ FdoDeviceUsageNotification( DeviceUsageTypeName(Type)); Fdo->Usage[Type]++; } else { - ASSERT(Fdo->Usage[Type] != 0); - - Info("%s: REMOVING %s\n", - __FdoGetName(Fdo), - DeviceUsageTypeName(Type)); - --Fdo->Usage[Type]; + if (Fdo->Usage[Type] != 0) { + Info("%s: REMOVING %s\n", + __FdoGetName(Fdo), + DeviceUsageTypeName(Type)); + --Fdo->Usage[Type]; + } } status = FdoForwardIrpSynchronously(Fdo, Irp);