]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/usb/qmi_wwan.c
qmi_wwan: fix NULL deref on disconnect
[karo-tx-linux.git] / drivers / net / usb / qmi_wwan.c
index ff6f39fe6c0059ab20d996ea791a950d7761abfd..8c373360827108855717f6d139034ff9f264bf0b 100644 (file)
@@ -1341,10 +1341,14 @@ static int qmi_wwan_probe(struct usb_interface *intf,
 static void qmi_wwan_disconnect(struct usb_interface *intf)
 {
        struct usbnet *dev = usb_get_intfdata(intf);
-       struct qmi_wwan_state *info = (void *)&dev->data;
+       struct qmi_wwan_state *info;
        struct list_head *iter;
        struct net_device *ldev;
 
+       /* called twice if separate control and data intf */
+       if (!dev)
+               return;
+       info = (void *)&dev->data;
        if (info->flags & QMI_WWAN_FLAG_MUX) {
                if (!rtnl_trylock()) {
                        restart_syscall();