From patchwork Sat Apr 16 18:06:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 65985 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp531322qge; Sat, 16 Apr 2016 11:06:27 -0700 (PDT) X-Received: by 10.140.169.132 with SMTP id p126mr34210450qhp.71.1460829987365; Sat, 16 Apr 2016 11:06:27 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g126si41127320qkb.106.2016.04.16.11.06.27; Sat, 16 Apr 2016 11:06:27 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 0E5A268794; Sat, 16 Apr 2016 18:06:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id EB1276878A; Sat, 16 Apr 2016 18:06:22 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C377F6878C; Sat, 16 Apr 2016 18:06:20 +0000 (UTC) Received: from mail-oi0-f49.google.com (mail-oi0-f49.google.com [209.85.218.49]) by lists.linaro.org (Postfix) with ESMTPS id 02FC468789 for ; Sat, 16 Apr 2016 18:06:20 +0000 (UTC) Received: by mail-oi0-f49.google.com with SMTP id s79so152512431oie.1 for ; Sat, 16 Apr 2016 11:06:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Y13FZTxeR/YAU6hhvfmAAWNFXvpAUmiMNB4MtX4TCy8=; b=a2sX8qMIOEpHg4qTrWk9yD5Op/Tlid5cOA4btLDB1PaZxhU7EaLfubQdNog57yD5/c 85s9UTP+qi8qKhOiARQU1DDIDcpi74U0IsfnQf6C9a3Xu4x4R1VCMit/DxiqWGk0PjG9 hCH1iwATYFgIKMSaHRe7LMu+GCCsUWHlEL/lQNlIml49zKZIQ960MumTEX11JZNsyHuM +tmIuCGoSCYh3G0AWAWuSeHibHJchAoG8jU8+ihqQ2P6ZheLNAE68BCdhn61KJqPWulh o+G9LsS71W69PikVeUwmCkvE19WAoFIHCoAZV3fzHPVkTLq6UAakTApRE0P2rJsLNlJb UkXg== X-Gm-Message-State: AOPr4FVvMYv5QgfaEvsokNnSbarp2Mwz3U+BE1gJszZwwo0xvmLnjYhfec1Y0D39oSQrkbOsQ80= X-Received: by 10.202.93.9 with SMTP id r9mr12831006oib.111.1460829979550; Sat, 16 Apr 2016 11:06:19 -0700 (PDT) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id r10sm16863790oih.15.2016.04.16.11.06.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 Apr 2016 11:06:19 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Sat, 16 Apr 2016 13:06:17 -0500 Message-Id: <1460829977-15362-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 X-Topics: patch Subject: [lng-odp] [PATCH] linux-generic: queue: avoid leakage on queue create X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" If a scheduled queue is created via odp_queue_create() but is unable to be added to the scheduler queues destroy it rather than leaking resources. This resolves Bug https://bugs.linaro.org/show_bug.cgi?id=2186 Reported-by: Maxim Uvarov Signed-off-by: Bill Fischofer --- platform/linux-generic/odp_queue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c index 5963057..8d29284 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -274,6 +274,7 @@ odp_queue_t odp_queue_create(const char *name, const odp_queue_param_t *param) if (handle != ODP_QUEUE_INVALID && type == ODP_QUEUE_TYPE_SCHED) { if (schedule_queue_init(queue)) { + odp_queue_destroy(handle); ODP_ERR("schedule queue init failed\n"); return ODP_QUEUE_INVALID; }