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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 BB683C38A24 for ; Thu, 7 May 2020 14:28:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 89925208DB for ; Thu, 7 May 2020 14:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588861715; bh=cdb5HhYYbgn0cqmn6y2JFhaVxDFfU8xbH0DMMtzfdrY=; h=From:To:Cc:Subject:Date:List-ID:From; b=ndpMJIWTxYkfQ4vNCjXmI4SM/8zvF+Ka4CsDzcKH5bVTXOeDy4D5kvP+H/YlpTEPQ 3ebly1hjCEs6EUJsXpIpYh0TBMQoB5I0ihpEG5uNJIkHSsr5SVxk+qQInMJybBN2zZ fKBLn3R2W9sCKDPWZcRh+S9ojnwueQRQKOXGdcnU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728148AbgEGO2d (ORCPT ); Thu, 7 May 2020 10:28:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:55266 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728138AbgEGO2c (ORCPT ); Thu, 7 May 2020 10:28:32 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B21A20B1F; Thu, 7 May 2020 14:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588861712; bh=cdb5HhYYbgn0cqmn6y2JFhaVxDFfU8xbH0DMMtzfdrY=; h=From:To:Cc:Subject:Date:From; b=EHV5Wbn1HmEKO7EVxKtljt/Oytm1B8ve0u1n9WMywYXNyla2HSVQVe4vhhqemvg5X frfP3hpbrRrC2eILWe2ApBIZR/ALO55kgwV3FNv/9gfgChNdyPfGbcCMgN2P7HZlA+ 1rRpzi/QCNq2IX98l2ldN/tHR/B47ZofY3NAfbNU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alaa Hleihel , Maor Gottlieb , Leon Romanovsky , Jason Gunthorpe , Sasha Levin , linux-rdma@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 01/35] RDMA/mlx4: Initialize ib_spec on the stack Date: Thu, 7 May 2020 10:27:55 -0400 Message-Id: <20200507142830.26239-1-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Alaa Hleihel [ Upstream commit c08cfb2d8d78bfe81b37cc6ba84f0875bddd0d5c ] Initialize ib_spec on the stack before using it, otherwise we will have garbage values that will break creating default rules with invalid parsing error. Fixes: a37a1a428431 ("IB/mlx4: Add mechanism to support flow steering over IB links") Link: https://lore.kernel.org/r/20200413132235.930642-1-leon@kernel.org Signed-off-by: Alaa Hleihel Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx4/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 369a203332a26..61a1b0bdede05 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c @@ -1492,8 +1492,9 @@ static int __mlx4_ib_create_default_rules( int i; for (i = 0; i < ARRAY_SIZE(pdefault_rules->rules_create_list); i++) { + union ib_flow_spec ib_spec = {}; int ret; - union ib_flow_spec ib_spec; + switch (pdefault_rules->rules_create_list[i]) { case 0: /* no rule */ -- 2.20.1