From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13CBAC433E1 for ; Thu, 20 Aug 2020 10:12:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C8AC12078D for ; Thu, 20 Aug 2020 10:12:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597918341; bh=IzTK1brHvbzYGCLGKWtVUX/++/DgFMolRIjMEhdKywU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Z3RXQPxvTp3GKXN5+4/5O+PLr/z0lq7fM81CK2wb6QhCbNrGHi5DVpQ0TQ1GGsMQH Lq+U3zZkp0ZH5uZCXyeqyFZaY//ZA7iIpOoe/j1eZ3Jfzq7D7mlvsPF53nLCSjlOu/ 3itsLAuf7LhEnFzla4NTQd1bYayi0FgCY5ySsRG8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731046AbgHTKMT (ORCPT ); Thu, 20 Aug 2020 06:12:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:53252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728160AbgHTKMQ (ORCPT ); Thu, 20 Aug 2020 06:12:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 91838206DA; Thu, 20 Aug 2020 10:12:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597918336; bh=IzTK1brHvbzYGCLGKWtVUX/++/DgFMolRIjMEhdKywU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hBHDD41Qg+qSC+pNhskUYmTAIcDLPHJQ21pVo2XM0klxFuqvXm4tS5gjzQyFZ6c+o z0371RLGjOn+RSsanGgrMcxb6KzdCQXwfrvfci1r2sDFhoP2iSAqoUJmzohbw5kmkB 5lxBU6eW1GfTPTJCCKL9g5QXoX9UZ7Sf7dh6pvV4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florinel Iordache , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 134/228] fsl/fman: fix eth hash table allocation Date: Thu, 20 Aug 2020 11:21:49 +0200 Message-Id: <20200820091614.281959075@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091607.532711107@linuxfoundation.org> References: <20200820091607.532711107@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Florinel Iordache [ Upstream commit 3207f715c34317d08e798e11a10ce816feb53c0f ] Fix memory allocation for ethernet address hash table. The code was wrongly allocating an array for eth hash table which is incorrect because this is the main structure for eth hash table (struct eth_hash_t) that contains inside a number of elements. Fixes: 57ba4c9b56d8 ("fsl/fman: Add FMan MAC support") Signed-off-by: Florinel Iordache Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/fman/fman_mac.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_mac.h b/drivers/net/ethernet/freescale/fman/fman_mac.h index dd6d0526f6c1f..19f327efdaff3 100644 --- a/drivers/net/ethernet/freescale/fman/fman_mac.h +++ b/drivers/net/ethernet/freescale/fman/fman_mac.h @@ -252,7 +252,7 @@ static inline struct eth_hash_t *alloc_hash_table(u16 size) struct eth_hash_t *hash; /* Allocate address hash table */ - hash = kmalloc_array(size, sizeof(struct eth_hash_t *), GFP_KERNEL); + hash = kmalloc(sizeof(*hash), GFP_KERNEL); if (!hash) return NULL; -- 2.25.1