mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
net/mlx5: Fix error handling when adding flow rules
If building match list or adding existing fg fails when
node is locked, function returned without unlocking it.
This happened if node version changed or adding existing fg
returned with EAGAIN after jumping to search_again_locked label.
Fixes: bd71b08ec2 ("net/mlx5: Support multiple updates of steering rules in parallel")
Signed-off-by: Vlad Buslov <[email protected]>
Reviewed-by: Maor Gottlieb <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
This commit is contained in:
parent
26a0f6e829
commit
9238e380e8
1 changed files with 8 additions and 2 deletions
|
|
@ -1759,8 +1759,11 @@ search_again_locked:
|
|||
|
||||
/* Collect all fgs which has a matching match_criteria */
|
||||
err = build_match_list(&match_head, ft, spec);
|
||||
if (err)
|
||||
if (err) {
|
||||
if (take_write)
|
||||
up_write_ref_node(&ft->node);
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
if (!take_write)
|
||||
up_read_ref_node(&ft->node);
|
||||
|
|
@ -1769,8 +1772,11 @@ search_again_locked:
|
|||
dest_num, version);
|
||||
free_match_list(&match_head);
|
||||
if (!IS_ERR(rule) ||
|
||||
(PTR_ERR(rule) != -ENOENT && PTR_ERR(rule) != -EAGAIN))
|
||||
(PTR_ERR(rule) != -ENOENT && PTR_ERR(rule) != -EAGAIN)) {
|
||||
if (take_write)
|
||||
up_write_ref_node(&ft->node);
|
||||
return rule;
|
||||
}
|
||||
|
||||
if (!take_write) {
|
||||
nested_down_write_ref_node(&ft->node, FS_LOCK_GRANDPARENT);
|
||||
|
|
|
|||
Loading…
Reference in a new issue