]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
mt76x2u: run device cleanup routine if resume fails
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Fri, 24 Aug 2018 08:17:49 +0000 (10:17 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 31 Aug 2018 15:53:12 +0000 (18:53 +0300)
Cleanup {tx,rx} and mcu queues if resume operation fails

Fixes: ee676cd5017c ("mt76: add driver code for MT76x2u based devices")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mediatek/mt76/mt76x2_usb.c

index f5338c364a859f1cd5480084a5636d9cd760e527..2a465c4e100968b1338210aadd62831de883edbb 100644 (file)
@@ -108,16 +108,24 @@ static int __maybe_unused mt76x2u_resume(struct usb_interface *intf)
                               mt76u_mcu_complete_urb,
                               &usb->mcu.cmpl);
        if (err < 0)
-               return err;
+               goto err;
 
        err = mt76u_submit_rx_buffers(&dev->mt76);
        if (err < 0)
-               return err;
+               goto err;
 
        tasklet_enable(&usb->rx_tasklet);
        tasklet_enable(&usb->tx_tasklet);
 
-       return mt76x2u_init_hardware(dev);
+       err = mt76x2u_init_hardware(dev);
+       if (err < 0)
+               goto err;
+
+       return 0;
+
+err:
+       mt76x2u_cleanup(dev);
+       return err;
 }
 
 MODULE_DEVICE_TABLE(usb, mt76x2u_device_table);