Daniel Zimmerman

- Check pdev and purb for NULL before accessing them. Resolves CID 764 and 763.
See issue #3908 for more details.

svn path=/trunk/; revision=37634
This commit is contained in:
Aleksey Bragin 2008-11-25 15:51:09 +00:00
parent 2cb63c5b32
commit 22cbf57aad

View file

@ -698,6 +698,8 @@ uhci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU
pdev = uhci_create_device(drvr_obj, dev_mgr);
if (pdev == NULL)
return pdev;
pdev_ext = pdev->DeviceExtension;
pdev_ext->pci_addr = bus_addr;
@ -707,9 +709,6 @@ uhci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU
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,10 +3121,11 @@ uhci_generic_urb_completion(PURB purb, PVOID context)
if (old_irql < DISPATCH_LEVEL)
KeRaiseIrql(DISPATCH_LEVEL, &old_irql);
pdev = purb->pdev;
if (purb == NULL)
return;
pdev = purb->pdev;
if (pdev == NULL)
return;