struct netlink_ext_ack *extack)
 {
        struct mlx5_tc_ct_priv *ct_priv = mlx5_tc_ct_get_ct_priv(priv);
+       struct flow_rule *rule = flow_cls_offload_flow_rule(f);
        struct flow_dissector_key_ct *mask, *key;
        bool trk, est, untrk, unest, new;
        u32 ctstate = 0, ctstate_mask = 0;
        u16 ct_state, ct_state_mask;
        struct flow_match_ct match;
 
-       if (!flow_rule_match_key(f->rule, FLOW_DISSECTOR_KEY_CT))
+       if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CT))
                return 0;
 
        if (!ct_priv) {
                return -EOPNOTSUPP;
        }
 
-       flow_rule_match_ct(f->rule, &match);
+       flow_rule_match_ct(rule, &match);
 
        key = match.key;
        mask = match.mask;
 
                       struct flow_cls_offload *f,
                       struct netlink_ext_ack *extack)
 {
-       if (!flow_rule_match_key(f->rule, FLOW_DISSECTOR_KEY_CT))
+       struct flow_rule *rule = flow_cls_offload_flow_rule(f);
+
+       if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CT))
                return 0;
 
        NL_SET_ERR_MSG_MOD(extack, "mlx5 tc ct offload isn't enabled.");