From 9638666d84a238a98595b51e6f68981ba4688bd8 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 4 May 2025 17:28:37 +0200 Subject: [PATCH] [MOUCLASS] Only set the device interface state if we have an interface name --- drivers/input/mouclass/mouclass.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/input/mouclass/mouclass.c b/drivers/input/mouclass/mouclass.c index 564f8ff62a6..d123508ef00 100644 --- a/drivers/input/mouclass/mouclass.c +++ b/drivers/input/mouclass/mouclass.c @@ -840,7 +840,8 @@ ClassPnp( } else DeviceExtension->FileHandle = NULL; - IoSetDeviceInterfaceState(&DeviceExtension->InterfaceName, TRUE); + if (DeviceExtension->InterfaceName.Length != 0) + IoSetDeviceInterfaceState(&DeviceExtension->InterfaceName, TRUE); Irp->IoStatus.Status = Status; IoCompleteRequest(Irp, IO_NO_INCREMENT); return Status; @@ -855,7 +856,8 @@ ClassPnp( break; case IRP_MN_REMOVE_DEVICE: - IoSetDeviceInterfaceState(&DeviceExtension->InterfaceName, FALSE); + if (DeviceExtension->InterfaceName.Length != 0) + IoSetDeviceInterfaceState(&DeviceExtension->InterfaceName, FALSE); if (DeviceExtension->FileHandle) { ZwClose(DeviceExtension->FileHandle);