From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0C6DEA0518; Thu, 23 Jul 2020 22:10:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BE7091C065; Thu, 23 Jul 2020 22:09:45 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80087.outbound.protection.outlook.com [40.107.8.87]) by dpdk.org (Postfix) with ESMTP id 320271C032 for ; Thu, 23 Jul 2020 22:09:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N/NkK5cWHOjEXwF8Xqjry0UsHPYSMHnVCrmHpCamhlet4tpo0VIevfrjGhG351APMRBn/kcgIbNShQx5/sHUuHxuT4GrT+2ZUrS/vllpKMNdoAfBtlosvj7NMGmkoYQELkl+I47oRyJorM04VWmRx56QCzNUOx2LyeMGJN+MnV26PnXg8Pl9asxqKBZaNJAjF51H/Ur1AVzlYq/Ht8J7k53KuoFMHoUfMFPGVeXcFBuD1fk1qgC9RAKjx/hTzeVAjSSQffjgW+RaAqv/MjVnrxfVModV32iwnXLSdcOIgwH5UrbrDSC5cd/V/gV5f8Qz/1181p0ErYuws0rwVQ9Hvw== 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:X-MS-Exchange-SenderADCheck; bh=jBckSGlVRAelxJZdaG8qEr/r4MZiBz6gqZABQJD0T2M=; b=Zki6YueuRBeCsv+eubTFN9m0qq7dFXPESF6lGUSKtswCHkcmZLpceK8e6g8o9y3qXfkPpTEfmP1HKRtRAg9rg0aZICdv7GkdPwVNrLR/bl5H5ApWWtVwC74dRXNflGgKgk/Ayqd/Muk64FGE3LsSrUAe8VtJRJ/BQSOWr06ZtstyNn5m9CPljgVCtK/6FvmMrkmaS3DqHKJ3DddevVBtRiPTuYTz6bBNmgQczm6QG+k6d1kjMdsG6FzkfXjtVz1Jrs5LPCegFzrk2+JqK36BoDANUKWS2dNpMYsgpQkX91RZRJuICiJyqO85k1iXr+6C6RDK9LzpxhdxcDH7TRpEdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jBckSGlVRAelxJZdaG8qEr/r4MZiBz6gqZABQJD0T2M=; b=r1/5AOPg8sSXJKXsUBmtRDXzL5aJbj/ZY7qB79PfM0pPNTkgWJD96ej1TvFb3QSADByYFk4O4ZqVOFipToUoegC0E/ihOZwnqpDZAq/m4uxGFhY+WMC5LRUMIv6QED8DVCa0Zy8apDnTfnHGBU5byyfkWZLWplWEzHARqZKhCIA= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from DB7PR05MB4876.eurprd05.prod.outlook.com (2603:10a6:10:1d::32) by DB7PR05MB5558.eurprd05.prod.outlook.com (2603:10a6:10:5c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.20; Thu, 23 Jul 2020 20:09:38 +0000 Received: from DB7PR05MB4876.eurprd05.prod.outlook.com ([fe80::8cb3:93cb:c3ef:4293]) by DB7PR05MB4876.eurprd05.prod.outlook.com ([fe80::8cb3:93cb:c3ef:4293%5]) with mapi id 15.20.3216.022; Thu, 23 Jul 2020 20:09:38 +0000 From: Parav Pandit To: dev@dpdk.org, grive@u256.net, ferruh.yigit@intel.com, thomas@monjalon.net Cc: rasland@mellanox.com, orika@mellanox.com, matan@mellanox.com, joyce.kong@arm.com, Parav Pandit Date: Thu, 23 Jul 2020 23:09:05 +0300 Message-Id: <20200723200910.376581-6-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200723200910.376581-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200723200910.376581-1-parav@mellanox.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: DM6PR03CA0009.namprd03.prod.outlook.com (2603:10b6:5:40::22) To DB7PR05MB4876.eurprd05.prod.outlook.com (2603:10a6:10:1d::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sw-mtx-036.mtx.labs.mlnx (208.176.44.194) by DM6PR03CA0009.namprd03.prod.outlook.com (2603:10b6:5:40::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.21 via Frontend Transport; Thu, 23 Jul 2020 20:09:37 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [208.176.44.194] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8c705c86-477e-4b87-6ce6-08d82f4453cf X-MS-TrafficTypeDiagnostic: DB7PR05MB5558: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1360; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5lgadj30aZLwrBthr3YC4kUBh59FQ3X9Z0ZD51bqpqzUSCzbRSWL68PlxsWLc+7YlAjrvKpgbPUZpyt9AauyZix3hI8xYfqFCoy9R3PCracrZFhQs+149FKsLketSUAZ3fMKxofo3NBVCSvS34Mqrw+0wBrbE76wURnw1kGi/w7IN1XTI9Fi/A/7+gHqg3LwxajBGgAFGz6wHXjSXySOHIfnh3iidJc01GJueQ8ST0L7NZf+O/pbkzCCzZ/9SS0oeU1t/HvGhOxIl1VAyER/9GRCcSEy5ia4EvipGzR+L97r3R7HX7aisFFBeiKiS26SgL9DuFw6ccUpi+tNcLpwGg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR05MB4876.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(346002)(366004)(396003)(136003)(39860400002)(6506007)(8676002)(8936002)(26005)(52116002)(2906002)(4326008)(478600001)(66946007)(66476007)(66556008)(83380400001)(36756003)(5660300002)(2616005)(6486002)(86362001)(956004)(1076003)(6512007)(6666004)(107886003)(186003)(16526019)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: RxZXTjgwz3YeIBcy2WFo7qfF07FYUdjpwh6AHlnsOP68/rUgBP6BEIcwavAq1nKZ+4cF2tB1pWAlRgxusmAOx5p/7kOr9VwoWxxlNa5g8Rn4LmQJZG/kPCB6KfQ0QnbLPmTIA2a3+06GnIoUlJ/lEnTePXLV5K2TFjus3WDOWdHUEL4DQv6BPG9gc1h4wNBuVgnWa0u2fJanBV1nhJaYUX+wCjKd5Btww4iE7Vk/oK6j0CqcFpDpUk+XR+Rr7x5up+jm2ur19snm1y6TZavD4TfJLJiBsMbankGyWwOCn2Mm4nXEJ3oyRn7TGmKthaB5k28wvYGf+pvuzu8jFwWGme16weAZ1NUGxAgSpWBR+MVxgpfICpYqHtn6K9O+aos8N0QKd+LxGM6uNHU3NiHgH418fEdyzm8iV88VPmT4K6B67LpU1ZJUPAihO5mzymycKOHuVB9onJnrVFLjK3NcZ+EZ+PzpktlRIcGAV/glWkolo85RBR/RSzT1feYJ5tsx X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c705c86-477e-4b87-6ce6-08d82f4453cf X-MS-Exchange-CrossTenant-AuthSource: DB7PR05MB4876.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2020 20:09:38.4738 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9zl1jx3N3UFfkKUwX9Q5yHq1Rf9sEICy+wZdnnEhj5doCDHXpxTgYdZa0lkYfKA4mZgDcOsHnbmRPOrhpgAU7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5558 Subject: [dpdk-dev] [PATCH v8 05/10] regex/mlx5: fix segmentation fault during error unwinding X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" When fail to initialize the device, avoid segmentation fault while accessing unintialized priv. Fixes: cfc672a90b74 ("regex/mlx5: support probing") Signed-off-by: Parav Pandit --- drivers/regex/mlx5/mlx5_regex.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/regex/mlx5/mlx5_regex.c b/drivers/regex/mlx5/mlx5_regex.c index 1ca5bfe9b..36ae9f809 100644 --- a/drivers/regex/mlx5/mlx5_regex.c +++ b/drivers/regex/mlx5/mlx5_regex.c @@ -137,17 +137,17 @@ mlx5_regex_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, if (ret) { DRV_LOG(ERR, "Unable to read HCA capabilities."); rte_errno = ENOTSUP; - goto error; + goto dev_error; } else if (!attr.regex || attr.regexp_num_of_engines == 0) { DRV_LOG(ERR, "Not enough capabilities to support RegEx, maybe " "old FW/OFED version?"); rte_errno = ENOTSUP; - goto error; + goto dev_error; } if (mlx5_regex_engines_status(ctx, 2)) { DRV_LOG(ERR, "RegEx engine error."); rte_errno = ENOMEM; - goto error; + goto dev_error; } priv = rte_zmalloc("mlx5 regex device private", sizeof(*priv), RTE_CACHE_LINE_SIZE); @@ -200,6 +200,7 @@ mlx5_regex_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, mlx5_glue->devx_free_uar(priv->uar); if (priv->regexdev) rte_regexdev_unregister(priv->regexdev); +dev_error: if (ctx) mlx5_glue->close_device(ctx); if (priv) -- 2.25.4