From patchwork Fri Oct 19 20:06:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10650121 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6EF2717D4 for ; Fri, 19 Oct 2018 20:06:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F02828498 for ; Fri, 19 Oct 2018 20:06:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 509AC284C9; Fri, 19 Oct 2018 20:06:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0505228498 for ; Fri, 19 Oct 2018 20:06:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726276AbeJTEO1 (ORCPT ); Sat, 20 Oct 2018 00:14:27 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:41356 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbeJTEO1 (ORCPT ); Sat, 20 Oct 2018 00:14:27 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w9JK3iIA120019; Fri, 19 Oct 2018 20:06:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=8kWpU7OK3fhNWHBQOX/qr6CqYBGT+vevUCSOBRLqMGI=; b=d8EZROYiIZ2y6WNgMehAkYDNUfWhBku+J4+6b/G5Igm/qaNwIY5UX0TnpoByWZJj0t/E OOeFF61ih1bi5LM2D5wwaqPc7uRmPXRRD+HFK04chAZfDUD7WCtzIA1TUAoVWavK3Sa8 fY90Od/Lyqw7wPG8GHV+HfBGjajcyCKBI4hLJ6pBZ4wJyXUGZLE0iLOamAIDfPke8QQi bOPygBOIB+1tT2miXqH7B2nHVt4MH645qWpx2bCjhRAp71DEcM74CNbaCeYMptaSjyF7 SF2+9lbcq+ifX2iKuIpb2us8YuB7Jz8N4AziMZ+zL1tSQUS68xB9bX/UmNpe1eeXE7Tn KA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2n384up58k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Oct 2018 20:06:47 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w9JK6lfB017518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Oct 2018 20:06:47 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w9JK6loE017239; Fri, 19 Oct 2018 20:06:47 GMT Received: from kili.mountain (/129.205.6.86) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 19 Oct 2018 13:06:46 -0700 Date: Fri, 19 Oct 2018 23:06:38 +0300 From: Dan Carpenter To: Saeed Mahameed , Paul Blakey Cc: Leon Romanovsky , linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] net/mlx5: allocate enough space in Message-ID: <20181019200638.dea3r4uocbij6d6j@kili.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9051 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810190178 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP FDB_MAX_CHAIN is 3. We wanted to allocate enough memory to hold four structs but there are missing parentheses so we only allocate enough memory for three structs and the first byte of the fourth one. Fixes: 328edb499f99 ("net/mlx5: Split FDB fast path prio to multiple namespaces") Signed-off-by: Dan Carpenter --- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c index 67ba4c975d81..9d73eb955f75 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c @@ -2470,7 +2470,7 @@ static int init_fdb_root_ns(struct mlx5_flow_steering *steering) return -ENOMEM; steering->fdb_sub_ns = kzalloc(sizeof(steering->fdb_sub_ns) * - FDB_MAX_CHAIN + 1, GFP_KERNEL); + (FDB_MAX_CHAIN + 1), GFP_KERNEL); if (!steering->fdb_sub_ns) return -ENOMEM;