From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0074.outbound.protection.outlook.com [104.47.0.74]) by dpdk.org (Postfix) with ESMTP id EB7E11C660 for ; Thu, 5 Apr 2018 10:56:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=qk+ZMbwELtwuxBZtYuJ2Fy6g0MYTZQih/wf/Qzx32hI=; b=KNcXrBmBOAbbWQtU5zFb8gIYLJ53sAiSyxTAvzuDMFpDuDvf8rNR2PGP7DqAD+GoaILjXzxgCDcSeasnMIUq3cgikryykz2vuC9s1DW/stsC60uPkwidbHMB4molO2oDVZGD2Iz1Wz6TTkF1rxBa45lox3jOChfU6p2nXiaT+x0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by DB3PR04MB0762.eurprd04.prod.outlook.com (2a01:111:e400:9440::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Thu, 5 Apr 2018 08:56:17 +0000 From: Hemant Agrawal To: ferruh.yigit@intel.com Cc: dev@dpdk.org, shreyansh.jain@nxp.com Date: Thu, 5 Apr 2018 14:24:17 +0530 Message-Id: <1522918464-4586-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: MA1PR0101CA0043.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::29) To DB3PR04MB0762.eurprd04.prod.outlook.com (2a01:111:e400:9440::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7a465569-dd2f-47c7-1c20-08d59ad3187d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB3PR04MB0762; X-Microsoft-Exchange-Diagnostics: 1; DB3PR04MB0762; 3:L9lZ2Y0IRex4XRKhG5oqlZ/1tgd6su5LxbEtAmY1GKCJ05t/FKsbsQvEb+WMYhlgz4ZtRbijjSa5JpTU/zSI4CsKCWzQ1ySUsX/DW0zSzFW2kaE868O7MpvKS37w3czLpbCyD9izEykxUL+Pbr15quReDIxZ9epcW4IUp5SAMdtuDYjVT1ho8TA+oBqUk9TwMYXCff+jYwmGpLPIxD+I+57tVtYoAxuGHjt9kiuIVbIDm3LuD+xUMu/nT3liLXde; 25:3fEKDwGozdV/FQQb57vAsdu+KxQcjY7j4KI1RqdnPMMI7WOuLmcDyhCNodfdbfAkUCLVvrIGA3qr2Mbe8L74AL0UsAOciHFr7XDHYqT4F2aGpAS4PId6V/SD/QmcW1EwfojLMK7+8fUqHwlHjON/7SN2TEh22WtgqdHZihXZYtPUX0jUkWDfqM5PgLOoiHvZY2IjaCBgjO62OuQ53gYszpWdPPZ+PfON+AIqFUFonLuzSrlRzIDWYJlicwbbcpK+NIsPG4hkjN0Lx6egH7Sex9R086wjuQf9xq1UAEcQ3Ce/LUVmABbQy4Oof3r490Q41bvfIcIz/YMPOMfaCmGr3A==; 31:PuLpNIe3lqCMN8Z/YMdd3P8n3ukfY7bG7DExld/bykG8tsR3bySOOD2FDM6l5AvJqVkcS+hSVh2uiyY0ppMPg1n2kmqLYJMGpa0SA+2jwxcqQ6KLAC6LN67dUqeLbrl3Ik1ptkm5RbshAdkxtChXjKquBfKgNrUm6NAgceWzp2F7+EDIerNjNbjUNouBvKtNXGunXbQltCHkFUe1BXYVMQxxcO+6hUCNO46R5AYmiHQ= X-MS-TrafficTypeDiagnostic: DB3PR04MB0762: X-Microsoft-Exchange-Diagnostics: 1; DB3PR04MB0762; 20:5CsZF3L9x6Vf4GKttfBWjD51+oJExyqWCoR1ELN3fUzBHitwBo69qJa0vnbWroqsdXNT1qD886q3Ng8nkYdETdrUK+mJzt/vCaSXK0z/ZXWvpog+JzOjxpqNJJn/74qC4e4ix7bXx72sTlW50pVkvn1lwW9i9ik7okw25u7U3MiMrlLVckGl/eDRMqn6ooZATYdQeR2NGVPyrkiJFBhCG650H7fWCTOZqCi0k5sTFDAYR6fVcC6ztDaG6nAdKHYwOI9BmFNwez6NQm2/z7iSUr+oLzJqsDZk/jv+pAbEId81U6pVda6gxw/xu4m33djevSPrjzTYJk7y/8lBy4w0Yv0pbR+GyO+hAkcKXSj5dCF5fPuVkomYsvfcQYW3UT+3VwzSO9VapVe8boQevOP4V/N0QsHwoxfviE/46/kmimHMPse/sotcpsaj8TH09uD1xvgaBmWVfwS/orIr7eLJ4FhrxSh9uqmLMQFbULvERGWvCEQ8VfpbUnImmBnJ+7FD; 4:RypvuBt8Ph86DHjkjLEhWwgF9mcHGgePa3T7rwwzok5sXi8lv9v8Z9u0JdaUGwbIMLkROPNIAoLo0Ah+QOCYV5d374CgaRCPPeOZ0w9YUNbDVy38qJDJyGh22222GorHYCWsySRLOvEUSLOAy+SR9RFDSgEIj9XVGzNmych2owBj29khv8Hi7i9Biwt0TM8OVhueOxHhfxnEt+39am8VtqJ/qAdwLtoFny/6+JLQTq2qI0RgtkkiHWBGApnVlDR9ll1eqRAjcrgPdk5JnAOV32nlKRbueMW9NOfDdKrytVYnVVZGlR1VaKgk3V6nsaFuv26kvuegorf9zAIdNMv/Y2Ozx3oiwOoDZ3srkaQpEM8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231221)(944501327)(52105095)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB3PR04MB0762; BCL:0; PCL:0; RULEID:; SRVR:DB3PR04MB0762; X-Forefront-PRVS: 06339BAE63 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(376002)(346002)(39860400002)(39380400002)(189003)(199004)(81166006)(53936002)(2361001)(2351001)(6916009)(25786009)(575784001)(7736002)(476003)(50226002)(86362001)(81156014)(486006)(97736004)(105586002)(26005)(6512007)(52116002)(3846002)(8936002)(16526019)(106356001)(51416003)(8676002)(386003)(48376002)(6486002)(47776003)(66066001)(68736007)(5660300001)(956004)(55236004)(478600001)(36756003)(6506007)(2906002)(2616005)(5009440100003)(59450400001)(305945005)(4326008)(6116002)(50466002)(186003)(316002)(16586007)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR04MB0762; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB3PR04MB0762; 23:EMWZwoWQOJErmDeFKwRDfUUzicedIwRmsxqHYHU9V?= =?us-ascii?Q?ukPfnpt/97+haj5FYlnrqKZBH5iBzjW6coYhZKgl6wnioNuL1rl4kIAgMGxq?= =?us-ascii?Q?l/wTrxhukJHma+cNLsonu6966g4HqPXuLxXYZ9TYhKTidij6TzSnLJQVaBh/?= =?us-ascii?Q?LHEw5Zy2mGMMT6FlO1jx2vNuG23IcuoXV7iC1W5sqvbbHyVuygZUg8rucImt?= =?us-ascii?Q?acWUiJ/H3A/qWhMvx0rhgBSQKtGyHLzUNF2KTJ0mz68esEN6T2vzSGpbelWP?= =?us-ascii?Q?7wfJeDit4VgFnCHc/Mkz1FuiU0gZavzWG0fUK+Q7XEMkQjHXfSIVgtIxSNXN?= =?us-ascii?Q?HBM4pcEKE7G4Aucz1M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SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB3PR04MB0762; 7:hmh9mgg/RvZVaZRCVrVKTMdqbc9S7gzOT25LsRlCkXuMlZnN4vnU+sNQ4Mme/mpqkuDlOKoTpeAMTjdZNlXIvbGzXPYCfT2E0yNpMgwX25KS+LwNHd1De4xs+Ew+JJ7XCq1ZoFdJYyv9ToSJmsur7i5P0fXS2ZMCj3S4YTRqe2Ir7nBDoJ2sIa3eeUZmu/iks0rNkW++5UC1a/TptneWO2GQqIR72bx8IWCyEckdv91g+A/ii0bTcHlXRiBOCxEt X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2018 08:56:17.2422 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a465569-dd2f-47c7-1c20-08d59ad3187d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR04MB0762 Subject: [dpdk-dev] [PATCH 1/8] bus/dpaa: fix the resource leak issue 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: , X-List-Received-Date: Thu, 05 Apr 2018 08:56:20 -0000 From: Sunil Kumar Kori Fixes: 9d32ef0f5d61 ("bus/dpaa: support creating dynamic HW portal") Coverity issue: 268332 Cc: stable@dpdk.org Signed-off-by: Sunil Kumar Kori Acked-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman_driver.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index 66838d2..07b29d5 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -160,6 +160,7 @@ struct qman_portal *fsl_qman_portal_create(void) &cpuset); if (ret) { error(0, ret, "pthread_getaffinity_np()"); + kfree(q_pcfg); return NULL; } @@ -168,12 +169,14 @@ struct qman_portal *fsl_qman_portal_create(void) if (CPU_ISSET(loop, &cpuset)) { if (q_pcfg->cpu != -1) { pr_err("Thread is not affine to 1 cpu\n"); + kfree(q_pcfg); return NULL; } q_pcfg->cpu = loop; } if (q_pcfg->cpu == -1) { pr_err("Bug in getaffinity handling!\n"); + kfree(q_pcfg); return NULL; } @@ -183,6 +186,7 @@ struct qman_portal *fsl_qman_portal_create(void) ret = process_portal_map(&q_map); if (ret) { error(0, ret, "process_portal_map()"); + kfree(q_pcfg); return NULL; } q_pcfg->channel = q_map.channel; @@ -217,6 +221,7 @@ struct qman_portal *fsl_qman_portal_create(void) close(q_fd); err1: process_portal_unmap(&q_map.addr); + kfree(q_pcfg); return NULL; } -- 2.7.4