Skip to content

Commit

Permalink
net: openvswitch: remove the unnecessary check
Browse files Browse the repository at this point in the history
Before invoking the ovs_meter_cmd_reply_stats, "meter"
was checked, so don't check it agin in that function.

Cc: Pravin B Shelar <pshelar@ovn.org>
Cc: Andy Zhou <azhou@ovn.org>
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tonghao Zhang authored and David S. Miller committed Apr 24, 2020
1 parent eb58eeb commit a8e3873
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions net/openvswitch/meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,11 @@ static int ovs_meter_cmd_reply_stats(struct sk_buff *reply, u32 meter_id,
if (nla_put_u32(reply, OVS_METER_ATTR_ID, meter_id))
goto error;

if (!meter)
return 0;

if (nla_put(reply, OVS_METER_ATTR_STATS,
sizeof(struct ovs_flow_stats), &meter->stats) ||
nla_put_u64_64bit(reply, OVS_METER_ATTR_USED, meter->used,
sizeof(struct ovs_flow_stats), &meter->stats))
goto error;

if (nla_put_u64_64bit(reply, OVS_METER_ATTR_USED, meter->used,
OVS_METER_ATTR_PAD))
goto error;

Expand Down

0 comments on commit a8e3873

Please sign in to comment.