On 21 Jun 2022, at 5:09, Jianbo Liu wrote:
> On Mon, 2022-06-20 at 12:14 +0200, Eelco Chaudron wrote: >> On 27 May 2022, at 11:00, Jianbo Liu wrote: >> >>> Add helpers to add, delete and get stats of police action with >>> the specified index. >>> >>> Signed-off-by: Jianbo Liu <[email protected]> >>> --- <SNIP> >>> +static int >>> +nl_parse_action_stats(struct nlattr *act_stats, >>> + struct ovs_flow_stats *stats_sw, >>> + struct ovs_flow_stats *stats_hw, >>> + struct ovs_flow_stats *stats_dropped) >>> +{ >>> + struct gnet_stats_basic bs_sw = { .packets = 0, .bytes = 0, }; >>> + struct nlattr *stats_attrs[ARRAY_SIZE(stats_policy)]; >>> + const struct gnet_stats_basic *bs_all = NULL; >>> + const struct gnet_stats_basic *bs_hw = NULL; >>> + const struct gnet_stats_queue *qs; >> >> We need a null check for stats here. >> >> if (!stats) { >> return EINVAL; >> } > > Are you talking about act_stats? > It should not be NULL, because [TCA_ACT_STATS] is not optional in > act_policy. You are right, it’s act_stats and the attribute is not an optional option. For some reason, I was thinking that nl_parse_action_stats() was a none-static function. Please ignore the comment. <SNIP>> _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
