mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[WIN32SS:ENG] Do not free LDEV if unloading a driver failed
Currently, LDEVOBJ_bUnloadImage always returns FALSE due to missing functionality in ntoskrnl. LDEVOBJ_vFreeLDEV contains an assert that driver is correctly unloaded before freeing it. Prevent this assert by calling LDEVOBJ_vFreeLDEV only if LDEVOBJ_bUnloadImage succeed. This can be easily triggered if DrvEnableDriver function (called in LDEVOBJ_bEnableDriver) fails.
This commit is contained in:
parent
7d71456144
commit
49246541de
1 changed files with 4 additions and 2 deletions
|
@ -442,8 +442,10 @@ LDEVOBJ_pLoadDriver(
|
||||||
ERR("LDEVOBJ_bEnableDriver failed\n");
|
ERR("LDEVOBJ_bEnableDriver failed\n");
|
||||||
|
|
||||||
/* Unload the image. */
|
/* Unload the image. */
|
||||||
LDEVOBJ_bUnloadImage(pldev);
|
if (LDEVOBJ_bUnloadImage(pldev))
|
||||||
LDEVOBJ_vFreeLDEV(pldev);
|
LDEVOBJ_vFreeLDEV(pldev);
|
||||||
|
else
|
||||||
|
ERR("Could not unload driver. Leaking memory\n");
|
||||||
pldev = NULL;
|
pldev = NULL;
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue