From patchwork Wed Aug 14 23:19:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Gross X-Patchwork-Id: 267213 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B28172C0207 for ; Thu, 15 Aug 2013 09:19:26 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933253Ab3HNXTX (ORCPT ); Wed, 14 Aug 2013 19:19:23 -0400 Received: from na3sys009aog103.obsmtp.com ([74.125.149.71]:58294 "HELO na3sys009aog103.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1760033Ab3HNXTV (ORCPT ); Wed, 14 Aug 2013 19:19:21 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]) (using TLSv1) by na3sys009aob103.postini.com ([74.125.148.12]) with SMTP ID DSNKUgwQeduKtuRsx52noD0p4cfM3EQartCJ@postini.com; Wed, 14 Aug 2013 16:19:21 PDT Received: by mail-pa0-f52.google.com with SMTP id kq13so186420pab.39 for ; Wed, 14 Aug 2013 16:19:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Anf+HsyQmH4XCF1B8wwBi/Fgmr2P7nSUZWRfvtiDzBI=; b=drWlUvQgvWjNckrBr1NX3M9XvGpj/XPYKxQMgZ7Sfv1F2xhV2UCYxuvxXhtajhWKzN MkAzyMOK+mtgO2rjvyL0qAfdnA5zHdLiQjuSkEUXya4rqC2Bm3ehBZlhMvkqDQLxy4/C tEkKJJatM74EQl6A12ILP2aVfNwRT9OIeU6fmDiRprLGF77dmGNxDo744lAHTzlZ4w3g TcchE494kzHMj0t2yblQFeYDSID1/9kYoxhS7YszsxnYCHuJX1Ai4yM9+npr4XvINYPP Ge+gd7knuZJxKnIgP7D/THXcZ79xY2iquutBxU2IK/q82tlRYV2vBmFHRE3YtEfDpuE8 fT8A== X-Gm-Message-State: ALoCoQmK28glD8Yu9J/Ep9o3+r6fgoTHvp1MeQNoI4UeuNWJbjY/p2RVK8ccHnzN2wGwpA9OGIhe/0os9aBXaVI/Rsv2n2bG7tyjcdIgl89KW3F5WV4GuR00wimfNlG/yBqMrRRLGMcMZcRAVEpQDds1gsZQNwiwGytDd1YJqEDbujzMUMX8ZMc= X-Received: by 10.68.177.196 with SMTP id cs4mr12364906pbc.45.1376522361101; Wed, 14 Aug 2013 16:19:21 -0700 (PDT) X-Received: by 10.68.177.196 with SMTP id cs4mr12364900pbc.45.1376522361024; Wed, 14 Aug 2013 16:19:21 -0700 (PDT) Received: from ubuntu.localdomain ([64.125.181.92]) by mx.google.com with ESMTPSA id y6sm52976765pbl.23.2013.08.14.16.19.18 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 16:19:19 -0700 (PDT) From: Jesse Gross To: David Miller Cc: netdev@vger.kernel.org, dev@openvswitch.org, Pravin B Shelar , Jesse Gross Subject: [PATCH net 2/3] openvswitch: Use correct type while allocating flex array. Date: Wed, 14 Aug 2013 16:19:06 -0700 Message-Id: <1376522347-39531-3-git-send-email-jesse@nicira.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1376522347-39531-1-git-send-email-jesse@nicira.com> References: <1376522347-39531-1-git-send-email-jesse@nicira.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Pravin B Shelar 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 Signed-off-by: Jesse Gross --- net/openvswitch/flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index 5c519b1..1aa84dc 100644 --- a/net/openvswitch/flow.c +++ b/net/openvswitch/flow.c @@ -240,7 +240,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;