Skip to content

Commit 645fd92

Browse files
idoschSasha Levin
authored andcommitted
Revert "flow_offload: action should not be NULL when it is referenced"
[ Upstream commit fa05bdb ] 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 <gushengxian@yulong.com> Fixes: 9ea3e52 ("flow_offload: action should not be NULL when it is referenced") Signed-off-by: Ido Schimmel <idosch@nvidia.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Link: https://lore.kernel.org/r/20210819105842.1315705-1-idosch@idosch.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 2f6c428 commit 645fd92

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎include/net/flow_offload.h‎

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

315-
if (action) {
316-
flow_action_for_each(i, action_entry, action) {
317-
if (i && action_entry->hw_stats != last_hw_stats) {
318-
NL_SET_ERR_MSG_MOD(extack, "Mixing HW stats types for actions is not supported");
319-
return false;
320-
}
321-
last_hw_stats = action_entry->hw_stats;
315+
flow_action_for_each(i, action_entry, action) {
316+
if (i && action_entry->hw_stats != last_hw_stats) {
317+
NL_SET_ERR_MSG_MOD(extack, "Mixing HW stats types for actions is not supported");
318+
return false;
322319
}
320+
last_hw_stats = action_entry->hw_stats;
323321
}
324322
return true;
325323
}

0 commit comments

Comments
 (0)