From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 07FD8A0C46; Tue, 28 Sep 2021 06:09:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81C1540E3C; Tue, 28 Sep 2021 06:09:12 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2088.outbound.protection.outlook.com [40.107.244.88]) by mails.dpdk.org (Postfix) with ESMTP id 5428740DF6; Tue, 28 Sep 2021 06:09:11 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DwXbOOhAE5ZU0x25vmxjL8r5YbfOMWpzZqh1HWD9jFDgXvU8RLs9rIeQLs+vyAYoTbfmLIBSWUpuclYrXlyEtuQRMWp4fSAwCO2aYZvXtncx8ePduEr4RIW8ZglhfHbH0aA0GfhFv4ZzySXn+75tXxrUlryXbw3lxjRVnf/WSzLlU5C/rDkqjpRmAxHY1Nxn6lXZaXXuKTX7KdFx4kupuy5lSIylfC0MfHt76bh6zQt92IXI41kgporCjn0LE023sQpUGRuWNeaXJLhKYYP363hvjb09By1EjnZBfnYzSXDA6jza/DDs6L+qCgG3l7Q8oJqcJHKwDpYHiXkW49HCqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/SMtXg0l0sFLVi6kpxZnCFg3ydciXzDcgQpb2S+yv6w=; b=Mg67jz8HKPQtLGPLztnRL/xymBnZCvyezhe3X4fDVKjRIH2xmgr1b19Ck90nTiRKTUH+1OGUJizMJsmor/w4fP2zkYwYK0fiWyPBI9ghpYpX4utG4VkPWHvTwjikqEmGORR/NybGZZBi0t1gnPa4hDr5M0yujag2GdDkNWWPqzRJSTokvGsPnfERk5StWBk47tutWJSAoapSl61aZ+tjNqpI1KB3LKIKpf4XLorMAghmQO0PKcpA9NUP4QpveWmomGuHWhEBqmDKmytFWRgrwVmNUz4OiLkI+HkMy6uAT8bvqVI6KeceQPFFjYalAwdQYq36jefHpcs02bGhrn8Vxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/SMtXg0l0sFLVi6kpxZnCFg3ydciXzDcgQpb2S+yv6w=; b=SHpD2XyDmWowMYcmCCoBsJ42NXCu1C8UIUqpva5VpecZbAlDiXiCFaM/ybA9jxH4dVJWvm247pT6gWsm5I9Ulr/V5Bx5stDW4HTgPnkJdpl99rr4iBEjnD15g92Vnh9susZshaynZOMyUvJclm8VTg3UtBoGot9+2wydyHZ7T7oz1xT1HKWOAtlbXlzk9UF/LDDj5Kw52laTczkswPOUZVNvk4HpNCTKoLYxoL8IKdPmkwuNVVIJNyZUoDHpdbQGbmrORtFehwRKN7+sntGmLYo1om0SCLPiyZPpCPrwbiu8mGDh13VegQu4rFH4wfIwPVKrwwf/7vQtpynK4KoCFw== Received: from DM5PR19CA0035.namprd19.prod.outlook.com (2603:10b6:3:9a::21) by MWHPR12MB1231.namprd12.prod.outlook.com (2603:10b6:300:e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Tue, 28 Sep 2021 04:09:09 +0000 Received: from DM6NAM11FT063.eop-nam11.prod.protection.outlook.com (2603:10b6:3:9a:cafe::28) by DM5PR19CA0035.outlook.office365.com (2603:10b6:3:9a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Tue, 28 Sep 2021 04:09:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT063.mail.protection.outlook.com (10.13.172.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4544.13 via Frontend Transport; Tue, 28 Sep 2021 04:09:09 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 28 Sep 2021 04:09:07 +0000 Received: from nvidia.com (172.20.187.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 28 Sep 2021 04:09:05 +0000 From: Bing Zhao To: , CC: , , , Date: Tue, 28 Sep 2021 07:08:51 +0300 Message-ID: <20210928040851.56636-1-bingz@nvidia.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 61d1185f-f07f-4f6f-a403-08d98235b8cf X-MS-TrafficTypeDiagnostic: MWHPR12MB1231: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Vavmlh4+irAP9AA+OsiVN5dUZ4TeZUgh0KPmicbqnBtA4Au/V1kvBOctmZ9ILXAJr3JioWo7OhT2Tl1eliy2s8gJXQgM0BhfCUwlfFhIycOoMOLz03LhUVly1/282mmWobtIW7hnCRlurvuoTImHOikuIdwEEvqwRj6zCXvZcHfN0CkHJvJpsvc9rZ24MRSd7u1HIDKo4SQEz+StCD7n69zhhYzN/YAwlkoNFVPJkfSmGZZeArxpiMUfdheO9SjuVM8kDipD6jHOJkQyo/rswpl2rB/lTEBI5mjUldZeKbAnjTX9rFgY/MJa6UwXdToVvr9FfJeE+n8vM+9ciUp4Ls3sd0NGvb7k69b3N+iR90Ii9UmGtG51V7Bc9EGkvDZ8ioIsUn8Td8QMPCjIvE6CN6h4ESTNJXABkBPMLFFFLtfRC9VofhjpMqtl2uPbVxiuYCtiJ0a27EoH9WmeGLNL9EWXMiDZ2WgtLj0Z76fRXfXhyKj0KN37Nt1U91UBVfVy7SzCJHZibPmMeKumooNLV8etd0u3H4MAq/48cfjpF7jG7+zfs/EFdHODdF7DOkYegsTiLwtyLQTEqdzi7bkIOssLJWeZMYB43wfMtD90n3mIDeSH2+a4rWv2lFbR6X0ij5T4kzDSnCL8kZ2xDZwD91Zg8thOTj+wDEAeYBCHSMh+QraK/lTePBwWiLko9gOBQjKKa104uQFU+SYh9tDcjw== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(70586007)(83380400001)(47076005)(6286002)(107886003)(6666004)(6636002)(2906002)(7696005)(82310400003)(36860700001)(70206006)(36756003)(55016002)(336012)(426003)(2616005)(186003)(16526019)(1076003)(8676002)(5660300002)(26005)(36906005)(86362001)(110136005)(508600001)(450100002)(54906003)(316002)(356005)(4326008)(8936002)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2021 04:09:09.3959 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 61d1185f-f07f-4f6f-a403-08d98235b8cf X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT063.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1231 Subject: [dpdk-dev] [PATCH] net/mlx5: fix flow tables double release X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In the function mlx5_alloc_shared_dr(), there are various reasons to result in a failure and error clean up process. While in the caller of mlx5_dev_spawn(), once there is a error occurring after the mlx5_alloc_shared_dr(), the mlx5_os_free_shared_dr() is called to release all the resources. To prevent a double release, the pointers of the resources should be checked before the releasing and set to NULL after done. In the mlx5_free_table_hash_list(), after the releasing, the pointer was missed to set to NULL and a double release may cause a crash. By setting the tables pointer to NULL as done for other resources, the double release and crash could be solved. Fixes: 54534725d2f3 ("net/mlx5: fix flow table hash list conversion") Cc: matan@mellanox.com Cc: stable@dpdk.org Signed-off-by: Bing Zhao --- drivers/net/mlx5/mlx5.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 02ea2e781e..3c10f186e6 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1369,6 +1369,7 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv) if (!sh->flow_tbls) return; mlx5_hlist_destroy(sh->flow_tbls); + sh->flow_tbls = NULL; } /** -- 2.27.0