From: Pravin B Shelar Date: Thu, 25 Jul 2013 18:25:21 +0000 (-0700) Subject: datapath: Use correct type while allocating flex array. X-Git-Tag: sliver-openvswitch-2.0.90-1~34^2~29 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=8e1a83d8f335932fd210c079bcb96c82e790e373;hp=994dea5bf4c1c5a760be608cc60e25734fd2524e;p=sliver-openvswitch.git datapath: 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 Acked-by: Jesse Gross --- diff --git a/datapath/flow.c b/datapath/flow.c index c6a90b936..21e956c2d 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -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;