]> git.karo-electronics.de Git - linux-beck.git/blobdiff - drivers/usb/core/devio.c
Merge with rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
[linux-beck.git] / drivers / usb / core / devio.c
index d01bd77e7b1479028086a98a09997378840366ee..545da37afca7bdec6f464d547d575f02570d10cc 100644 (file)
@@ -137,10 +137,10 @@ static ssize_t usbdev_read(struct file *file, char __user *buf, size_t nbytes, l
                struct usb_device_descriptor temp_desc ; /* 18 bytes - fits on the stack */
 
                memcpy(&temp_desc, &dev->descriptor, sizeof(dev->descriptor));
-               le16_to_cpus(&temp_desc->bcdUSB);
-               le16_to_cpus(&temp_desc->idVendor);
-               le16_to_cpus(&temp_desc->idProduct);
-               le16_to_cpus(&temp_desc->bcdDevice);
+               le16_to_cpus(&temp_desc.bcdUSB);
+               le16_to_cpus(&temp_desc.idVendor);
+               le16_to_cpus(&temp_desc.idProduct);
+               le16_to_cpus(&temp_desc.bcdDevice);
 
                len = sizeof(struct usb_device_descriptor) - pos;
                if (len > nbytes)
@@ -493,7 +493,8 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype, unsig
 {
        int ret = 0;
 
-       if (ps->dev->state != USB_STATE_CONFIGURED)
+       if (ps->dev->state != USB_STATE_ADDRESS
+        && ps->dev->state != USB_STATE_CONFIGURED)
                return -EHOSTUNREACH;
        if (USB_TYPE_VENDOR == (USB_TYPE_MASK & requesttype))
                return 0;