Skip to content

Commit

Permalink
iavf: don't clear a lock we don't hold
Browse files Browse the repository at this point in the history
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: 640a8af ("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>
  • Loading branch information
Nicholas Nunley authored and Tony Nguyen committed Nov 15, 2021
1 parent 89f22f1 commit 2135a8d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/ethernet/intel/iavf/iavf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 2135a8d

Please sign in to comment.