kaweth: fix firmware download
authorOliver Neukum <oneukum@suse.com>
Wed, 17 Aug 2016 13:51:55 +0000 (15:51 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 Aug 2016 06:25:33 +0000 (23:25 -0700)
This fixes the oops discovered by the Umap2 project and Alan Stern.
The intf member needs to be set before the firmware is downloaded.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/kaweth.c

index 770212baaf05ddb032967730acc6b0ff46ec8f40..37bf715ab53b649473230966fb26bbaa620538dd 100644 (file)
@@ -1029,6 +1029,7 @@ static int kaweth_probe(
        kaweth = netdev_priv(netdev);
        kaweth->dev = udev;
        kaweth->net = netdev;
+       kaweth->intf = intf;
 
        spin_lock_init(&kaweth->device_lock);
        init_waitqueue_head(&kaweth->term_wait);
@@ -1139,8 +1140,6 @@ err_fw:
 
        dev_dbg(dev, "Initializing net device.\n");
 
-       kaweth->intf = intf;
-
        kaweth->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
        if (!kaweth->tx_urb)
                goto err_free_netdev;