diff options
-rw-r--r-- | lib/rhashtable.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index a8583af43b59..9c84f5cef69c 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c | |||
@@ -175,8 +175,7 @@ static struct bucket_table *bucket_table_alloc(struct rhashtable *ht, | |||
175 | int i; | 175 | int i; |
176 | static struct lock_class_key __key; | 176 | static struct lock_class_key __key; |
177 | 177 | ||
178 | size = sizeof(*tbl) + nbuckets * sizeof(tbl->buckets[0]); | 178 | tbl = kvzalloc(struct_size(tbl, buckets, nbuckets), gfp); |
179 | tbl = kvzalloc(size, gfp); | ||
180 | 179 | ||
181 | size = nbuckets; | 180 | size = nbuckets; |
182 | 181 | ||