Skip to content

Commit 2135a8d

Browse files
ndnunleyanguy11
authored andcommitted
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: 640a8af ("i40evf: Reorder configure_clsflower to avoid deadlock on error") Signed-off-by: Nicholas Nunley <[email protected]> Tested-by: Tony Brelinski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 89f22f1 commit 2135a8d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3095,8 +3095,10 @@ static int iavf_configure_clsflower(struct iavf_adapter *adapter,
30953095
return -ENOMEM;
30963096

30973097
while (!mutex_trylock(&adapter->crit_lock)) {
3098-
if (--count == 0)
3099-
goto err;
3098+
if (--count == 0) {
3099+
kfree(filter);
3100+
return err;
3101+
}
31003102
udelay(1);
31013103
}
31023104

0 commit comments

Comments
 (0)