From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0065.outbound.protection.outlook.com [104.47.41.65]) by dpdk.org (Postfix) with ESMTP id 981654B4B for ; Mon, 22 Jan 2018 18:46:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=huSBvPV1RS8X0061gFR4g5VP06IWjvIxZBl1s2Q8qdA=; b=KcOHJNh4JU9rWlWSvH4UiWHaf7VMeOHZnAMxtjU4qLViH9YFXHuQDzVqugSt4DPsQJxhx5sv6t33i/9YTkG0HzTa1ZVTwSt/6Ov4rdROZLO5juBmkbpyqxi923n0I1lRUtHFTyEETsOcgOvmO7FbN+M8dAmSQXdlo6Oi+6SYNDg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by MWHPR07MB3472.namprd07.prod.outlook.com (10.164.192.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Mon, 22 Jan 2018 17:46:46 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, harry.van.haaren@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Mon, 22 Jan 2018 23:16:01 +0530 Message-Id: <20180122174601.19217-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: SG2PR06CA0178.apcprd06.prod.outlook.com (10.175.208.32) To MWHPR07MB3472.namprd07.prod.outlook.com (10.164.192.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 87090a13-9a37-43c7-31f5-08d561c01c55 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:MWHPR07MB3472; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3472; 3:Jv7kDjGXejZdyvx2/UXByDswrx1h9BY2r8bQ3BB9jPsEBwTJjpBg12QWuSBFue2w3/j3sSMB6ZIMQPBwgRLOgCXogQ9MC4hGP58KwaF+1cBrrBvOGForgKWwgQdOzyHB7/vz8jmUHQi7H4zY4IRDUkGk4zBczTJdefQeGKjoWY8AhZjo+yb0JVcjEiUnOg68iixn711bokHpQ5zDWFXQdcTNWnUWvgFj368vl6ERM+wJ2podO+Nfzv+QYdltFsZx; 25:FnL9e8WJyGdwxJ9Jem1M6NiMyUYmNCtOvUSfFTgqEfIdXEgvZNM0Wlv9hwcpwXsD2h1D4M4/dSeDhUV0GWtvkHEGmIk0avI132Xgd8occO8ehaTlBe/QVzk1k3xfXgjMRp9xjinjYpsB8FCaM3S0hgMFGq4CqfNAWeCGzKpuwibj+bB+6akfd91wQB/J5CVwrGlcAVqSDuPOSskfw0FtXCAhIqtN13/wzTODPzysj+UYrV0QOaiB/SlJlJ47xM5l6yXeuBh8cNaKo1v61aH+uHqnw1NCGYTV3dQAAYrcnZ8max4v0fmpGMjqI7AxnxUQxb7mHq9BX10x4rjXRBj1TA==; 31:nEfJHVKRThLENySTmJeqy8DwE4BRpcAZ7ph3NtpCBzJPMD74KijOV73+XQrTSph9gmVHdGLRPkE8VZwO4wKkMx5G30UevfZOF0bfRo06lCw5rEemdxgebrgJ8lBE2ShFR71gH8to1e0K9eVwYLna4H1dXxlSW+2XH5ev2vAjFAxBhXpM/PSBr4chF4Oe59iEEj8EB7I+nbR7OsWdePHNt18+qHnHd4GlGkPBh2fXXXU= X-MS-TrafficTypeDiagnostic: MWHPR07MB3472: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3472; 20:qhfWv/4WI1AIQeA/M6YEmDXjLq7pNICjuw3LYaYyqO2XzgorMa4N/a6csR6wV49eTt9YQhOh8ZvyAApsi0K2OxJ6bKN1LCPsHAfts5DcTVPOWbgLARQkir4ZpN2tUKJqNqXFy+9OqTFzV8AlVPAb6QFJrOF9IQ/DMWsXt+4hbr0wCk4POBCtlLA0PkDs0YGXZk+NvFuIIRaVxbSjbM4oc1jIMyvRBkOOTIrjeCY4A+IpLmhPV0vSQFN6iuZLkhCKoP/y9ChTCg6Rgd3BwVyUVlLiSk7KV9EgadDs/n6/Bu/KS7QvjhBEYPFNienLJkbHjDsdJUfT4seJO5Hebqx3NWzUleUHK/bs5S9eSoUvc/XRPXAHXfYcYfTUdz8F4uwvNxOuoz31IwOwG/xBPaglHTm/m0GaDT9lAKKg3uvjbicfodcHYZfslOfp76MNbebGJ0yASJAu2tzgWX7EIdDN/N0idrhhkvYPGxmFZ93ADBQ2tbCpZBnA7bT/CDlDYbI8TpWV41xug54bAri8D1Zgxye5EVuDqn0UmWLbmZPKoGz8Pc8P1c0K1eTXL5bHQTOn4bQgGuCmReGfQljHGdErhzxbwLGU5vAVd3oZK1wMNVE=; 4:wjqSw6/UHanuo3XiVrWT51DaDyai5uiF9nm+kTlPv2sctBX4/Ib0aG1fJiygBQ9/nsgnUdw3gv/fhycCJg2HpPc3Pj/Kxzg4jfaYX88yZbaTfXJ2NtgXEspcLP/ZvZdZqwKSVLXk6c2ixfPv3co8s8NKJjxTlN3khwNT6q8Cc0DxblDxDD9yR6wrv8q1Z2J6Rrq1O4CyYpTCYoCQ+EY0jLAj9Y4lNxg3lvvlm3ilBmDsNOGPTwAF7wZOPCt9dHXdwQyEnLVu/hAjvzKQRcXuZoYzHyd45ikprQBrsD3PrOSUglq8I6PbX+99xsYGQLhB X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(131327999870524); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(3231023)(2400081)(944501161)(6041288)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:MWHPR07MB3472; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:MWHPR07MB3472; X-Forefront-PRVS: 0560A2214D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(6069001)(39860400002)(366004)(39380400002)(376002)(396003)(346002)(199004)(189003)(105586002)(81166006)(8676002)(81156014)(68736007)(36756003)(72206003)(16526018)(47776003)(26005)(386003)(6666003)(52116002)(42882006)(50226002)(5009440100003)(8936002)(5660300001)(48376002)(50466002)(51416003)(66066001)(6506007)(25786009)(6512007)(305945005)(4326008)(106356001)(2906002)(97736004)(16586007)(316002)(7736002)(3846002)(6116002)(1076002)(53936002)(107886003)(478600001)(6486002)(42262002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3472; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR07MB3472; 23:2Ok+EES7P1SWMQnP1gEhYF9/lRh2PqBBZTTouGA5a?= =?us-ascii?Q?CQxNRSj0JWYpXluKTJjBwMTtb267CptLdB8DpYxmCe1ZN63R21WidyoY5+xv?= =?us-ascii?Q?8Kr6y5ehjb4VOX5clPhcauCInYpWUuZn/B1yyNwu1th4ULq2uEGtGcHiQJWW?= =?us-ascii?Q?tn0C3wWEcinGcIitCXVzRt0lIhIJ1k5yQUPhEFiFcN0EFEfEauwCK25kJDVB?= =?us-ascii?Q?Hedlu86BR8Lg91AIrRIGQik1A5LBJkX9Q6120NZERs6U0RdOsZV/I51+ARtH?= =?us-ascii?Q?mXVMaC5yGltbohNLa5hhyUhEXgQdFFYB95FDbHd/OJ8W1yHWuGeuRUidnW05?= =?us-ascii?Q?vuWRPfrz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ascii?Q?re2PK30i5G6xQ61x2o=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3472; 6:YhbxSlYKy/RRl8/ufp7pO7nUiNkQc01h7kuvBRx6sTIkR/7wuIyp4Q9LY7CpCv1W0AFe4ThO0XH7qqVn/IgMvXRZOGIs6NnVhKuvCcO7RfAZ2wkBSZ7o8oWz+G0UBvHIZ08mV4Eijp29ZbSD8IeqT/7x0DqvbKfv0ByVVzEX4WmqrgCDIeLoNDYHmFsq9FY38auCJ10YRR9qsBvdexrBE4/Z7NMDVFkMjpF1GM5ERT2VI3RzjjMoX9/QXWkNZwMu4Wpcn3v0iacaBg1io0mJ8popHa12+o379YHJIeGSDDfXYaMmpxgtTp0DVUnJPzaG3nst7SLm1tYvkordGP4b08VhML3gDSX1UTIlKPcRd7c=; 5:hgG5CE2//Lqlecwr4LJxdMjXBtCkTsJLBXXgg8MH53DoMAD9EbyQ9wTyS+Krn16qcrLW3tQmdxJpbO1twfjk/jSN8T/DcFuiRkqJoM2KH+4ldZSL1vRkXFEH+PLcuF+VUrGkrlneNfU5OP/EyFm4mhdewc4KhjpHGm0yGIsbWkk=; 24:VOZacw3RECgS4QhDfYkNhulMxet2h/scCX8gy4H5MafMhth/JviDZOjcwBTxSCfSKr33KEjdK6gGhu5rpvv3tAugg6kSyBv5qX2Czczv1dM=; 7:snY5fhASMdDwwttjoObGUG7oY7fvuZnlJj3ZRI9XUrZBZKogJFdPV5c5GFb9tEaMhP6nwSkDyDLAX6fcrtGfFj0xsoDzBcPLxbQzTI9M2FEDM0Yg8HvjjXJEZyaXX9Yt2aJi9GKBxBo+Ll4EifFwBS3LLUP+QGyglUJa4mB3yUoS3YP4z4tBwnZlWxiokiDeJk4QfSYDdlHiPdJvHZDKfSaFfqTOsSzJs0Q3Xi58mc00AFySzi1exya+2Akw1Rgc SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2018 17:46:46.5691 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 87090a13-9a37-43c7-31f5-08d561c01c55 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3472 Subject: [dpdk-dev] [PATCH] drivers/event: fix resource leak in selftest 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: Mon, 22 Jan 2018 17:46:50 -0000 Free resources leak in eventdev selftests. Coverity issue: 257044 Coverity issue: 257047 Coverity issue: 257009 Fixes: 9ef576176db0 ("test/eventdev: add octeontx multi queue and multi port") Fixes: 3a17ff401f1e ("test/eventdev: add basic SW tests") Fixes: 5e6eb5ccd788 ("event/sw: make test standalone") Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx/ssovf_evdev_selftest.c | 4 +++- drivers/event/sw/sw_evdev_selftest.c | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/event/octeontx/ssovf_evdev_selftest.c b/drivers/event/octeontx/ssovf_evdev_selftest.c index 3866ba968..5e012a95a 100644 --- a/drivers/event/octeontx/ssovf_evdev_selftest.c +++ b/drivers/event/octeontx/ssovf_evdev_selftest.c @@ -624,8 +624,10 @@ launch_workers_and_wait(int (*master_worker)(void *), ret = rte_event_dequeue_timeout_ticks(evdev, rte_rand() % 10000000/* 10ms */, &dequeue_tmo_ticks); - if (ret) + if (ret) { + free(param); return -1; + } param[0].total_events = &atomic_total_events; param[0].sched_type = sched_type; diff --git a/drivers/event/sw/sw_evdev_selftest.c b/drivers/event/sw/sw_evdev_selftest.c index 8c2eef569..78d30e07a 100644 --- a/drivers/event/sw/sw_evdev_selftest.c +++ b/drivers/event/sw/sw_evdev_selftest.c @@ -3016,9 +3016,12 @@ static struct rte_mempool *eventdev_func_mempool; int test_sw_eventdev(void) { - struct test *t = malloc(sizeof(struct test)); + struct test *t; int ret; + t = malloc(sizeof(struct test)); + if (t == NULL) + return -1; /* manually initialize the op, older gcc's complain on static * initialization of struct elements that are a bitfield. */ @@ -3236,6 +3239,7 @@ test_sw_eventdev(void) printf("SW Eventdev Selftest Successful.\n"); return 0; test_fail: + free(t); printf("SW Eventdev Selftest Failed.\n"); return -1; } -- 2.16.0