datapath: Use correct type while allocating flex array.
authorPravin B Shelar <pshelar@nicira.com>
Thu, 25 Jul 2013 18:25:21 +0000 (11:25 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Thu, 25 Jul 2013 18:25:21 +0000 (11:25 -0700)
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 <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/flow.c

index c6a90b9..21e956c 100644 (file)
@@ -429,7 +429,7 @@ static struct flex_array *alloc_buckets(unsigned int n_buckets)
        struct flex_array *buckets;
        int i, err;
 
-       buckets = flex_array_alloc(sizeof(struct hlist_head *),
+       buckets = flex_array_alloc(sizeof(struct hlist_head),
                                   n_buckets, GFP_KERNEL);
        if (!buckets)
                return NULL;