Aric Stewart : hidclass.sys: Do not use device after free.

Alexandre Julliard julliard at winehq.org
Mon Dec 19 16:53:07 CST 2016


Module: wine
Branch: master
Commit: 3af89f1d96f74e81f159a3a6b3deb2c5cb69e42a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3af89f1d96f74e81f159a3a6b3deb2c5cb69e42a

Author: Aric Stewart <aric at codeweavers.com>
Date:   Sat Dec 17 12:21:11 2016 -0600

hidclass.sys: Do not use device after free.

Spotted by Marcus Meissner (Coverity issue 1372459).

Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/hidclass.sys/pnp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c
index 5df7692..b92457f 100644
--- a/dlls/hidclass.sys/pnp.c
+++ b/dlls/hidclass.sys/pnp.c
@@ -255,8 +255,9 @@ NTSTATUS WINAPI HID_PNP_Dispatch(DEVICE_OBJECT *device, IRP *irp)
         }
         case IRP_MN_REMOVE_DEVICE:
         {
+            rc = minidriver->PNPDispatch(device, irp);
             HID_DeleteDevice(&minidriver->minidriver, device);
-            return minidriver->PNPDispatch(device, irp);
+            return rc;
         }
         default:
         {




More information about the wine-cvs mailing list