2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

dpif-netdev: Don't check if xcalloc() failed when creating meter.

xcalloc() can't return null.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Justin Pettit
2018-08-28 17:28:28 -07:00
parent e9b33ad780
commit d0db81eac8

View File

@@ -5199,7 +5199,7 @@ dpif_netdev_meter_set(struct dpif *dpif, ofproto_meter_id meter_id,
/* Allocate meter */
meter = xzalloc(sizeof *meter
+ config->n_bands * sizeof(struct dp_meter_band));
if (meter) {
meter->flags = config->flags;
meter->n_bands = config->n_bands;
meter->max_delta_t = 0;
@@ -5235,8 +5235,6 @@ dpif_netdev_meter_set(struct dpif *dpif, ofproto_meter_id meter_id,
meter_unlock(dp, mid);
return 0;
}
return ENOMEM;
}
static int