diff options
author | 2021-06-04 09:48:55 -0700 | |
---|---|---|
committer | 2021-11-15 15:40:04 -0800 | |
commit | 2135a8d5c8186bc92901dc00f179ffd50e54c2ac (patch) | |
tree | 9e6ec36bcc751cb7e54b1da09f5a49cd40e18c61 | |
parent | iavf: free q_vectors before queues in iavf_disable_vf (diff) | |
download | wireguard-linux-2135a8d5c8186bc92901dc00f179ffd50e54c2ac.tar.xz wireguard-linux-2135a8d5c8186bc92901dc00f179ffd50e54c2ac.zip |
iavf: don't clear a lock we don't hold
In iavf_configure_clsflower() the function will bail out if it is unable
to obtain the crit_section lock in a reasonable time. However, it will
clear the lock when exiting, so fix this.
Fixes: 640a8af5841f ("i40evf: Reorder configure_clsflower to avoid deadlock on error")
Signed-off-by: Nicholas Nunley <nicholas.d.nunley@intel.com>
Tested-by: Tony Brelinski <tony.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/ethernet/intel/iavf/iavf_main.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c index c23fff5a4bd9..28661e4425f1 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_main.c +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -3095,8 +3095,10 @@ static int iavf_configure_clsflower(struct iavf_adapter *adapter, return -ENOMEM; while (!mutex_trylock(&adapter->crit_lock)) { - if (--count == 0) - goto err; + if (--count == 0) { + kfree(filter); + return err; + } udelay(1); } |