[USB-BRINGUP-TRUNK]
authorCameron Gutman <aicommander@gmail.com>
Fri, 20 Jan 2012 22:35:52 +0000 (22:35 +0000)
committerCameron Gutman <aicommander@gmail.com>
Fri, 20 Jan 2012 22:35:52 +0000 (22:35 +0000)
- Fix uninitialized variable use and more build errors

svn path=/branches/usb-bringup-trunk/; revision=55027

drivers/usb/usbhub_new/fdo.c
drivers/usb/usbhub_new/pdo.c
drivers/usb/usbstor/pdo.c

index 89eb166..5e54f99 100644 (file)
@@ -800,7 +800,7 @@ NTSTATUS
 CreateDeviceIds(
     PDEVICE_OBJECT UsbChildDeviceObject)
 {
-    NTSTATUS Status;
+    NTSTATUS Status = STATUS_SUCCESS;
     ULONG Index;
     PWCHAR BufferPtr;
     WCHAR Buffer[100];
@@ -965,6 +965,7 @@ CreateDeviceIds(
        if (UsbChildExtension->usInstanceId.Buffer == NULL)
        {
            DPRINT1("Error: failed to allocate %lu bytes\n", Index * sizeof(WCHAR));
+           Status = STATUS_INSUFFICIENT_RESOURCES;
            goto Cleanup;
        }
 
index 6632c02..cb4ff2c 100644 (file)
@@ -284,8 +284,8 @@ USBHUB_PdoHandleInternalDeviceControl(
                         DPRINT1("Connect %x\n", ((PortStatus.Status & USB_PORT_STATUS_CONNECT) << 1) << ((PortId - 1) * 2));
                         DPRINT1("Enable %x\n", ((PortStatus.Status & USB_PORT_STATUS_ENABLE) >> 1) << ((PortId - 1) * 2));
                         *PortStatusBits +=
-                            ((PortStatus.Status & USB_PORT_STATUS_CONNECT) << 1) << ((PortId - 1) * 2) +
-                            ((PortStatus.Status & USB_PORT_STATUS_ENABLE) >> 1) << ((PortId - 1) * 2);
+                            (((PortStatus.Status & USB_PORT_STATUS_CONNECT) << 1) << ((PortId - 1) * 2)) +
+                            (((PortStatus.Status & USB_PORT_STATUS_ENABLE) >> 1) << ((PortId - 1) * 2));
                         
                     }
                 }
index 732c934..ecb6ab8 100644 (file)
@@ -153,7 +153,7 @@ USBSTOR_GetGenericType(
 ULONG
 CopyField(
     IN PUCHAR Name,
-    IN PUCHAR Buffer,
+    IN PCHAR Buffer,
     IN ULONG MaxLength)
 {
     ULONG Index;
@@ -261,7 +261,7 @@ USBSTOR_PdoHandleQueryDeviceId(
 {
     PPDO_DEVICE_EXTENSION DeviceExtension;
     NTSTATUS Status;
-    UCHAR Buffer[100];
+    CHAR Buffer[100];
     LPCSTR DeviceType;
     ULONG Offset = 0;
     PUFI_INQUIRY_RESPONSE InquiryData;