Skip to content

Commit 42415c9

Browse files
Pravin B Shelarjessegross
authored andcommitted
openvswitch: Use correct type while allocating flex array.
Flex array is used to allocate hash buckets which is type struct hlist_head, but we use `struct hlist_head *` to calculate array size. Since hlist_head is of size pointer it works fine. Following patch use correct type. Signed-off-by: Pravin B Shelar <[email protected]> Signed-off-by: Jesse Gross <[email protected]>
1 parent 30444e9 commit 42415c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/openvswitch/flow.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ static struct flex_array *alloc_buckets(unsigned int n_buckets)
240240
struct flex_array *buckets;
241241
int i, err;
242242

243-
buckets = flex_array_alloc(sizeof(struct hlist_head *),
243+
buckets = flex_array_alloc(sizeof(struct hlist_head),
244244
n_buckets, GFP_KERNEL);
245245
if (!buckets)
246246
return NULL;

0 commit comments

Comments
 (0)