Skip to content

Commit 9ea3e52

Browse files
gushengxiandavem330
authored andcommitted
flow_offload: action should not be NULL when it is referenced
"action" should not be NULL when it is referenced. Signed-off-by: gushengxian <[email protected]> Signed-off-by: gushengxian <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3f2db25 commit 9ea3e52

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

include/net/flow_offload.h

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

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;
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;
326329
}
327-
last_hw_stats = action_entry->hw_stats;
328330
}
329331
return true;
330332
}

0 commit comments

Comments
 (0)