Skip to content

Commit

Permalink
net/ibmvnic: free reset work of removed device from queue
Browse files Browse the repository at this point in the history
Commit 36f1031 ("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: 36f1031 ("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>
  • Loading branch information
Juliet Kim authored and David S. Miller committed Sep 7, 2019
1 parent 63b2ed4 commit 1c2977c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/ethernet/ibm/ibmvnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down

0 comments on commit 1c2977c

Please sign in to comment.