]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/usb/rndis_host.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen...
[linux-2.6-omap-h63xx.git] / drivers / net / usb / rndis_host.c
index 727547a289920dd59b7ca2ec3045c031cd75c856..21a7785cb8b67fe43f311a42ff26907ee589e84e 100644 (file)
@@ -218,7 +218,7 @@ EXPORT_SYMBOL_GPL(rndis_command);
  * ActiveSync 4.1 Windows driver.
  */
 static int rndis_query(struct usbnet *dev, struct usb_interface *intf,
-               void *buf, u32 oid, u32 in_len,
+               void *buf, __le32 oid, u32 in_len,
                void **reply, int *reply_len)
 {
        int retval;
@@ -283,7 +283,8 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
                struct rndis_set_c      *set_c;
                struct rndis_halt       *halt;
        } u;
-       u32                     tmp, *phym;
+       u32                     tmp, phym_unspec;
+       __le32                  *phym;
        int                     reply_len;
        unsigned char           *bp;
 
@@ -363,12 +364,15 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
                goto halt_fail_and_release;
 
        /* Check physical medium */
+       phym = NULL;
        reply_len = sizeof *phym;
        retval = rndis_query(dev, intf, u.buf, OID_GEN_PHYSICAL_MEDIUM,
                        0, (void **) &phym, &reply_len);
-       if (retval != 0)
+       if (retval != 0 || !phym) {
                /* OID is optional so don't fail here. */
-               *phym = RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED;
+               phym_unspec = RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED;
+               phym = &phym_unspec;
+       }
        if ((flags & FLAG_RNDIS_PHYM_WIRELESS) &&
                        *phym != RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) {
                if (netif_msg_probe(dev))