Skip to content

Commit b867247

Browse files
committed
Merge branch 'qed-error-codes'
Asbjørn Sloth Tønnesen says: ==================== net: qede: avoid overruling error codes This series fixes the qede driver, so that qede_parse_flow_attr() and it's subfunctions doesn't get their error codes overruled (ie. turning -EOPNOTSUPP into -EINVAL). --- I have two more patches along the same lines, but they are not yet causing any issues, so I have them destined for net-next. (those are for qede_flow_spec_validate_unused() and qede_flow_parse_ports().) After that I have a series for converting to extack + the final one for validating control flags. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 16f5030 + f26f719 commit b867247

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

drivers/net/ethernet/qlogic/qede/qede_filter.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,8 +1868,8 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
18681868
struct flow_cls_offload *f)
18691869
{
18701870
struct qede_arfs_fltr_node *n;
1871-
int min_hlen, rc = -EINVAL;
18721871
struct qede_arfs_tuple t;
1872+
int min_hlen, rc;
18731873

18741874
__qede_lock(edev);
18751875

@@ -1879,7 +1879,8 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
18791879
}
18801880

18811881
/* parse flower attribute and prepare filter */
1882-
if (qede_parse_flow_attr(edev, proto, f->rule, &t))
1882+
rc = qede_parse_flow_attr(edev, proto, f->rule, &t);
1883+
if (rc)
18831884
goto unlock;
18841885

18851886
/* Validate profile mode and number of filters */
@@ -1888,11 +1889,13 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
18881889
DP_NOTICE(edev,
18891890
"Filter configuration invalidated, filter mode=0x%x, configured mode=0x%x, filter count=0x%x\n",
18901891
t.mode, edev->arfs->mode, edev->arfs->filter_count);
1892+
rc = -EINVAL;
18911893
goto unlock;
18921894
}
18931895

18941896
/* parse tc actions and get the vf_id */
1895-
if (qede_parse_actions(edev, &f->rule->action, f->common.extack))
1897+
rc = qede_parse_actions(edev, &f->rule->action, f->common.extack);
1898+
if (rc)
18961899
goto unlock;
18971900

18981901
if (qede_flow_find_fltr(edev, &t)) {
@@ -1998,10 +2001,9 @@ static int qede_flow_spec_to_rule(struct qede_dev *edev,
19982001
if (IS_ERR(flow))
19992002
return PTR_ERR(flow);
20002003

2001-
if (qede_parse_flow_attr(edev, proto, flow->rule, t)) {
2002-
err = -EINVAL;
2004+
err = qede_parse_flow_attr(edev, proto, flow->rule, t);
2005+
if (err)
20032006
goto err_out;
2004-
}
20052007

20062008
/* Make sure location is valid and filter isn't already set */
20072009
err = qede_flow_spec_validate(edev, &flow->rule->action, t,

0 commit comments

Comments
 (0)