mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTOS:PNP] Fix bug causing all devices be considered as already existing
We should compare against DeviceObject as DeviceInstance is never NULL. Fix a resource leak as well. The bug CORE-18983 seems to lay somewhere else though, I just stumbled upon this one while researching it. Note there is a BSOD in the PnP manager on reboot after the driver installation failure, but it seems it was uncovered by the fix as opposed to caused by it.
This commit is contained in:
parent
fa388640ca
commit
29a706fc5a
1 changed files with 2 additions and 3 deletions
|
@ -218,15 +218,14 @@ IopInitializeDevice(
|
|||
|
||||
/* Leave, if the device already exists */
|
||||
DeviceObject = IopGetDeviceObjectFromDeviceInstance(&DeviceInstance);
|
||||
if (DeviceInstance.Buffer != NULL)
|
||||
if (DeviceObject != NULL)
|
||||
{
|
||||
DPRINT1("Device %wZ already exists!\n", &DeviceInstance);
|
||||
ObDereferenceObject(DeviceObject);
|
||||
Status = STATUS_SUCCESS;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ObDereferenceObject(DeviceObject);
|
||||
|
||||
DPRINT("Device %wZ does not exist!\n", &DeviceInstance);
|
||||
|
||||
/* Create a device node for the device instance */
|
||||
|
|
Loading…
Reference in a new issue