]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net/ibmvnic: free reset work of removed device from queue
authorJuliet Kim <julietk@linux.vnet.ibm.com>
Thu, 5 Sep 2019 21:30:01 +0000 (17:30 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Sep 2019 15:36:14 +0000 (17:36 +0200)
Commit 36f1031c51a2 ("ibmvnic: Do not process reset during or after
 device removal") made the change to exit reset if the driver has been
removed, but does not free reset work items of the adapter from queue.

Ensure all reset work items are freed when breaking out of the loop early.

Fixes: 36f1031c51a2 ("ibmnvic: Do not process reset during or after device removal”)
Signed-off-by: Juliet Kim <julietk@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c

index fa4bb940665c2fccd1933d7e4db9289d0d550cbc..6644cabc8e756b31d881b367298786dd687d3431 100644 (file)
@@ -1985,7 +1985,10 @@ static void __ibmvnic_reset(struct work_struct *work)
        while (rwi) {
                if (adapter->state == VNIC_REMOVING ||
                    adapter->state == VNIC_REMOVED)
-                       goto out;
+                       kfree(rwi);
+                       rc = EBUSY;
+                       break;
+               }
 
                if (adapter->force_reset_recovery) {
                        adapter->force_reset_recovery = false;
@@ -2011,7 +2014,7 @@ static void __ibmvnic_reset(struct work_struct *work)
                netdev_dbg(adapter->netdev, "Reset failed\n");
                free_all_rwi(adapter);
        }
-out:
+
        adapter->resetting = false;
        if (we_lock_rtnl)
                rtnl_unlock();