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:
@@ -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;
|
||||
@@ -5236,8 +5236,6 @@ dpif_netdev_meter_set(struct dpif *dpif, ofproto_meter_id meter_id,
|
||||
|
||||
return 0;
|
||||
}
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
static int
|
||||
dpif_netdev_meter_get(const struct dpif *dpif,
|
||||
|
Reference in New Issue
Block a user