From patchwork Mon Jun 24 15:56:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2772231 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DECE19F245 for ; Mon, 24 Jun 2013 15:56:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BF49220126 for ; Mon, 24 Jun 2013 15:56:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C7CE20124 for ; Mon, 24 Jun 2013 15:56:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751013Ab3FXP4S (ORCPT ); Mon, 24 Jun 2013 11:56:18 -0400 Received: from mail-bk0-f45.google.com ([209.85.214.45]:60305 "EHLO mail-bk0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884Ab3FXP4R (ORCPT ); Mon, 24 Jun 2013 11:56:17 -0400 Received: by mail-bk0-f45.google.com with SMTP id je9so4215255bkc.4 for ; Mon, 24 Jun 2013 08:56:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=X7AQ3gyjColTcTln6+d5ToHvf9HlDGBacYqQG+FRpMQ=; b=pz/jPd61yRgIPXabfQge/bKzo0BOEbnVohWg6/GMAmSlqO2g5Q98LdfOcVPOQ1x8ZU GgqqfSEMTCnvCnVeV3OUeZYvjzkofLToLDFTJE5FJYL9xFjoFqOf6iJ0sefErA8aOGMe Fw0g2Hdwd3jQONJrm/AqRr/uWtTBXsvCFQUMYvlXL1LPxX/whNWpW1Pj587PmZ6RYOz2 gf9GfdCf0uV+fDe2fVbgy3IxRw8jPJd30y5hFfw4EYZ91hR7/mmlbz9T7n0CRo/J2SNp Ns8wqFWA4euzAB9OK9rXDCm8AtFQufU1VGdc0Lom4g74/7Z74se/Z0QJpkHonqvXYTlc ctqg== X-Received: by 10.205.113.6 with SMTP id eu6mr3704748bkc.62.1372089376097; Mon, 24 Jun 2013 08:56:16 -0700 (PDT) Received: from [192.168.1.102] (c-71-234-225-85.hsd1.ct.comcast.net. [71.234.225.85]) by mx.google.com with ESMTPSA id rj6sm5384823bkb.12.2013.06.24.08.56.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 08:56:15 -0700 (PDT) Message-ID: <51C86C1B.6030307@dev.mellanox.co.il> Date: Mon, 24 Jun 2013 11:56:11 -0400 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: "linux-rdma (linux-rdma@vger.kernel.org)" CC: Vladimir Koushnir Subject: [PATCH opensm] complib: Fix memory leak in cl_thread_pool_destroy function X-Gm-Message-State: ALoCoQmHhYd508vytaIKF1oJp/bSlaG+RbIjBU73z5FSxvHmCME7PazsVmwotitdkvv83S0OBndl Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vladimir Koushnir Signed-off-by: Vladimir Koushnir Signed-off-by: Hal Rosenstock --- complib/cl_threadpool.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/complib/cl_threadpool.c b/complib/cl_threadpool.c index 0f6498b..11abfbb 100644 --- a/complib/cl_threadpool.c +++ b/complib/cl_threadpool.c @@ -129,6 +129,9 @@ void cl_thread_pool_destroy(IN cl_thread_pool_t * const p_thread_pool) pthread_join(p_thread_pool->tid[i], NULL); p_thread_pool->running_count = 0; + + free(p_thread_pool->tid); + pthread_cond_destroy(&p_thread_pool->cond); pthread_mutex_destroy(&p_thread_pool->mutex);