Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp779461ybj; Thu, 7 May 2020 07:29:25 -0700 (PDT) X-Google-Smtp-Source: APiQypJcNSGmoNe0mfG6IOUwWK2xwbhRUhAPvKkkRROuncas7Q/s4CZb8ZQFCpkJKubf350FlK4b X-Received: by 2002:a17:906:3291:: with SMTP id 17mr11998538ejw.343.1588861765064; Thu, 07 May 2020 07:29:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588861765; cv=none; d=google.com; s=arc-20160816; b=FqEuyweParVGCsvY1cl0+3vZUqhcucfM1OV6OI2phjMPD0L6VrxPxLU800gDAHnI98 ecANBiMtdKgZc5UOx+rgJWPlnbfxZxQNtjKR0s3LeMB+P0xFPLsM/jwD+xFh7M+Cu1er BDwDO9A2Y8R7YpnVxzeiz2F3yZ5x58zb6u7P8bOWU0ApGkk4uSlLIvb8Xu8xhva6seLr WvJ3hgDjXw1BTtOeFN9mlVhLMPcs1X9H6huXpxVW1cGcdXDUhAEPwuUJkZQHF082dlHU 21FMGF6/VAgX29NJpFcKeL3nUac+SFd29Ana2ApnVzQ4NM7YFxX7CI/RQIA2TG262eCa q14Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=aSZrb4GCtgLv3vuRs3Tdang1sMPQn1+dQK0Ss/v9kJs=; b=Io8oSvGX9u/WO75l8RuYTNsf07PmPlHNqeZIjB3OQIF143idRC7yqnmEVKMX0sUqPK D2nSiFn7CX8X7fb3GpPnG+6KMtFH43lTh7yxiciMkX7NjKm3/7L1wtP1utGEyKhPPYL7 p4qoPenmIWTKe16Y9OhA2lNjlVzGiUQxt+ZhDnOZh8pCIRfMCrxaMoJ9ak4CxJOIZE9Q VpIjqwrpm5w/6i2eJOfF7CL8/XBRklnPb16XFmTW0WUfyYgwVobEO4wtUNvt89T/O7Md sO9/8bM7qyrCwJ0OACMIdJW15EO6mewWxI7ICmZLoyoJ8PBSoqWIBjQY4TMtQhfykukz E59w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=y43Hqv7n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si3473770eja.72.2020.05.07.07.28.58; Thu, 07 May 2020 07:29:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=y43Hqv7n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726382AbgEGO13 (ORCPT + 99 others); Thu, 7 May 2020 10:27:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:53116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbgEGO13 (ORCPT ); Thu, 7 May 2020 10:27:29 -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 C4F272083B; Thu, 7 May 2020 14:27:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588861648; bh=e0b9s7OdLWu3UwsM0eMiCMeu0kR0EfPAyMaj/JB6Kn0=; h=From:To:Cc:Subject:Date:From; b=y43Hqv7n6ShLSM2r6jRu3EKehaMZ+XFMaK9OX7Zw5lwQUrMID4ybRcvYr4xDzflwx TFnYfScoKnleAmg7z2fE5YdkF1/KrYWiy3PIkUBBQGL55ekV5eRzi88mLgslvzBv8j RJZICRVCmXju7poUxCzJjmwbmFCuSg4pP6P2FDnI= 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.6 01/50] RDMA/mlx4: Initialize ib_spec on the stack Date: Thu, 7 May 2020 10:26:37 -0400 Message-Id: <20200507142726.25751-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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 2f5d9b181848b..e5758eb0b7d27 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c @@ -1502,8 +1502,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