Author: fireball
Date: Tue Nov 25 09:51:09 2008
New Revision: 37634
URL:
http://svn.reactos.org/svn/reactos?rev=37634&view=rev
Log:
Daniel Zimmerman
- Check pdev and purb for NULL before accessing them. Resolves CID 764 and 763.
See issue #3908 for more details.
Modified:
trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c [iso-8859-1] Tue Nov 25 09:51:09
2008
@@ -698,6 +698,8 @@
pdev = uhci_create_device(drvr_obj, dev_mgr);
+ if (pdev == NULL)
+ return pdev;
pdev_ext = pdev->DeviceExtension;
pdev_ext->pci_addr = bus_addr;
@@ -706,9 +708,6 @@
slot_num.u.AsULONG = 0;
slot_num.u.bits.DeviceNumber = ((bus_addr & 0xff) >> 3);
slot_num.u.bits.FunctionNumber = (bus_addr & 0x07);
-
- if (pdev == NULL)
- return pdev;
//now create adapter object
RtlZeroMemory(&dev_desc, sizeof(dev_desc));
@@ -3122,9 +3121,10 @@
if (old_irql < DISPATCH_LEVEL)
KeRaiseIrql(DISPATCH_LEVEL, &old_irql);
- pdev = purb->pdev;
if (purb == NULL)
return;
+
+ pdev = purb->pdev;
if (pdev == NULL)
return;