[ros-diffs] [fireball] 23728: Don't crash during disconnection if a device doesn't have a driver

fireball at svn.reactos.org fireball at svn.reactos.org
Sat Aug 26 23:09:11 CEST 2006


Author: fireball
Date: Sun Aug 27 01:09:11 2006
New Revision: 23728

URL: http://svn.reactos.org/svn/reactos?rev=23728&view=rev
Log:
Don't crash during disconnection if a device doesn't have a driver

Modified:
    trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c

Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c?rev=23728&r1=23727&r2=23728&view=diff
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c Sun Aug 27 01:09:11 2006
@@ -922,6 +922,14 @@
             pdrvr = pdev->dev_driver;
             dev_obj = pdev->dev_obj;
         }
+
+        if (dev_obj == NULL)
+        {
+            // it means no driver was found for the device and thus no device object created
+            // we just do nothing here
+            return TRUE;
+        }
+
         pdrvr_ext = (PGENDRV_DRVR_EXTENSION) pdrvr->driver_ext;
         pdev_ext = (PGENDRV_DEVICE_EXTENSION) dev_obj->DeviceExtension;
     }




More information about the Ros-diffs mailing list