mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-08 18:45:49 -04:00
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: 640a8af584 ("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>
This commit is contained in:
committed by
Tony Nguyen
parent
89f22f1296
commit
2135a8d5c8
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user