Blob Blame History Raw
From 54b8e94b33419c07a2e04193b185412a08d4786f Mon Sep 17 00:00:00 2001
From: Alaa Hleihel <ahleihel@redhat.com>
Date: Sun, 10 May 2020 15:04:16 -0400
Subject: [PATCH 097/312] [netdrv] net/mlx5: fix kvfree of uninitialized
 pointer spec

Message-id: <20200510150452.10307-52-ahleihel@redhat.com>
Patchwork-id: 306675
Patchwork-instance: patchwork
O-Subject: [RHEL8.3 BZ 1789380 v2 51/87] net/mlx5: fix kvfree of uninitialized pointer spec
Bugzilla: 1789380
RH-Acked-by: Kamal Heib <kheib@redhat.com>
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
RH-Acked-by: Jonathan Toppins <jtoppins@redhat.com>

Bugzilla: http://bugzilla.redhat.com/1789380
Upstream: v5.5-rc1

commit 8b3f2eb038d3098b37715afced1e62bbc72da90f
Author: Colin Ian King <colin.king@canonical.com>
Date:   Tue Nov 5 18:27:40 2019 +0000

    net/mlx5: fix kvfree of uninitialized pointer spec

    Currently when a call to  esw_vport_create_legacy_ingress_acl_group
    fails the error exit path to label 'out' will cause a kvfree on the
    uninitialized pointer spec.  Fix this by ensuring pointer spec is
    initialized to NULL to avoid this issue.

    Addresses-Coverity: ("Uninitialized pointer read")
    Fixes: 10652f39943e ("net/mlx5: Refactor ingress acl configuration")
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>

Signed-off-by: Alaa Hleihel <ahleihel@redhat.com>
Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 1937198405e1..93cf6eb77163 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -1257,7 +1257,7 @@ static int esw_vport_ingress_config(struct mlx5_eswitch *esw,
 	struct mlx5_flow_destination drop_ctr_dst = {0};
 	struct mlx5_flow_destination *dst = NULL;
 	struct mlx5_flow_act flow_act = {0};
-	struct mlx5_flow_spec *spec;
+	struct mlx5_flow_spec *spec = NULL;
 	int dest_num = 0;
 	int err = 0;
 	u8 *smac_v;
-- 
2.13.6