Skip to content

Commit fa05bdb

Browse files
idoschkuba-moo
authored andcommitted
Revert "flow_offload: action should not be NULL when it is referenced"
This reverts commit 9ea3e52. Cited commit added a check to make sure 'action' is not NULL, but 'action' is already dereferenced before the check, when calling flow_offload_has_one_action(). Therefore, the check does not make any sense and results in a smatch warning: include/net/flow_offload.h:322 flow_action_mixed_hw_stats_check() warn: variable dereferenced before check 'action' (see line 319) Fix by reverting this commit. Cc: gushengxian <[email protected]> Fixes: 9ea3e52 ("flow_offload: action should not be NULL when it is referenced") Signed-off-by: Ido Schimmel <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d584566 commit fa05bdb

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

include/net/flow_offload.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,14 +319,12 @@ flow_action_mixed_hw_stats_check(const struct flow_action *action,
319319
if (flow_offload_has_one_action(action))
320320
return true;
321321

322-
if (action) {
323-
flow_action_for_each(i, action_entry, action) {
324-
if (i && action_entry->hw_stats != last_hw_stats) {
325-
NL_SET_ERR_MSG_MOD(extack, "Mixing HW stats types for actions is not supported");
326-
return false;
327-
}
328-
last_hw_stats = action_entry->hw_stats;
322+
flow_action_for_each(i, action_entry, action) {
323+
if (i && action_entry->hw_stats != last_hw_stats) {
324+
NL_SET_ERR_MSG_MOD(extack, "Mixing HW stats types for actions is not supported");
325+
return false;
329326
}
327+
last_hw_stats = action_entry->hw_stats;
330328
}
331329
return true;
332330
}

0 commit comments

Comments
 (0)