diff options
Diffstat (limited to 'net/openvswitch/flow_table.c')
| -rw-r--r-- | net/openvswitch/flow_table.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c index ffc72a741a50..b75236aa4414 100644 --- a/net/openvswitch/flow_table.c +++ b/net/openvswitch/flow_table.c @@ -150,14 +150,13 @@ static void __table_instance_destroy(struct table_instance *ti) static struct table_instance *table_instance_alloc(int new_size) { - struct table_instance *ti = kmalloc(sizeof(*ti), GFP_KERNEL); + struct table_instance *ti = kmalloc_obj(*ti, GFP_KERNEL); int i; if (!ti) return NULL; - ti->buckets = kvmalloc_array(new_size, sizeof(struct hlist_head), - GFP_KERNEL); + ti->buckets = kvmalloc_objs(struct hlist_head, new_size, GFP_KERNEL); if (!ti->buckets) { kfree(ti); return NULL; @@ -367,7 +366,7 @@ static struct mask_cache *tbl_mask_cache_alloc(u32 size) (size * sizeof(struct mask_cache_entry)) > PCPU_MIN_UNIT_SIZE) return NULL; - new = kzalloc(sizeof(*new), GFP_KERNEL); + new = kzalloc_obj(*new, GFP_KERNEL); if (!new) return NULL; @@ -965,7 +964,7 @@ static struct sw_flow_mask *mask_alloc(void) { struct sw_flow_mask *mask; - mask = kmalloc(sizeof(*mask), GFP_KERNEL); + mask = kmalloc_obj(*mask, GFP_KERNEL); if (mask) mask->ref_count = 1; @@ -1110,8 +1109,7 @@ void ovs_flow_masks_rebalance(struct flow_table *table) int i; /* Build array of all current entries with use counters. */ - masks_and_count = kmalloc_array(ma->max, sizeof(*masks_and_count), - GFP_KERNEL); + masks_and_count = kmalloc_objs(*masks_and_count, ma->max, GFP_KERNEL); if (!masks_and_count) return; |
