]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/net/usb/qmi_wwan.c
net: qmi_wwan: fix divide by 0 on bad descriptors
[mirror_ubuntu-artful-kernel.git] / drivers / net / usb / qmi_wwan.c
index 8c373360827108855717f6d139034ff9f264bf0b..a4f229edcceb8cbd545603b426d8d9568577d36b 100644 (file)
@@ -681,7 +681,7 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
        }
 
        /* errors aren't fatal - we can live with the dynamic address */
-       if (cdc_ether) {
+       if (cdc_ether && cdc_ether->wMaxSegmentSize) {
                dev->hard_mtu = le16_to_cpu(cdc_ether->wMaxSegmentSize);
                usbnet_get_ethernet_addr(dev, cdc_ether->iMACAddress);
        }