Skip to content

Commit a8e3873

Browse files
hao022davem330
authored andcommitted
net: openvswitch: remove the unnecessary check
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>
1 parent eb58eeb commit a8e3873

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎net/openvswitch/meter.c‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,11 @@ static int ovs_meter_cmd_reply_stats(struct sk_buff *reply, u32 meter_id,
242242
if (nla_put_u32(reply, OVS_METER_ATTR_ID, meter_id))
243243
goto error;
244244

245-
if (!meter)
246-
return 0;
247-
248245
if (nla_put(reply, OVS_METER_ATTR_STATS,
249-
sizeof(struct ovs_flow_stats), &meter->stats) ||
250-
nla_put_u64_64bit(reply, OVS_METER_ATTR_USED, meter->used,
246+
sizeof(struct ovs_flow_stats), &meter->stats))
247+
goto error;
248+
249+
if (nla_put_u64_64bit(reply, OVS_METER_ATTR_USED, meter->used,
251250
OVS_METER_ATTR_PAD))
252251
goto error;
253252

0 commit comments

Comments
 (0)