From patchwork Sat Apr 16 18:21:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 65986 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp535846qge; Sat, 16 Apr 2016 11:21:45 -0700 (PDT) X-Received: by 10.55.75.85 with SMTP id y82mr33951130qka.29.1460830905763; Sat, 16 Apr 2016 11:21:45 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id v63si14622604qka.83.2016.04.16.11.21.45; Sat, 16 Apr 2016 11:21:45 -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 D6E9C68799; Sat, 16 Apr 2016 18:21:44 +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 EB93668791; Sat, 16 Apr 2016 18:21:40 +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 3931968795; Sat, 16 Apr 2016 18:21:39 +0000 (UTC) Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com [209.85.218.51]) by lists.linaro.org (Postfix) with ESMTPS id 0A27A68789 for ; Sat, 16 Apr 2016 18:21:37 +0000 (UTC) Received: by mail-oi0-f51.google.com with SMTP id r78so18080588oie.0 for ; Sat, 16 Apr 2016 11:21:37 -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=+P22jV8QDtOZvZgxOb1B9l64LpZGAPDGSBudKiCVOGc=; b=GxKnUSoc1AreSbWqoE2rQp0qC9AC/Ny8BDcmQtthNbJZ0O/zDapqRl0EJzh+Hge/qc 1pzEK7pn7WSkbTBH0CgoP0cij6k2SiRNn9+oUV5udH1C/A3SKrZDuAOOXNoXdz4fnN9M BhWeQONb8l5sq1Xtu06RVkdfxVnKHjEZpSTUmRcL0Kc29AvPuxsMZa/br3KmAO1WWSHq x5WM9o+Nj3ECBXJ5Qig3ZfyHX4td4aa+yUabDJytnHjBoi520SmBSv8P7ZtlV7TF0tgl VXOaLBEHSOXWReKoKHC9oqjPjuuS0F1dUmJZmP9ez91Wj6OhFTgniR2oTXm+7S1sQmzd 11Og== X-Gm-Message-State: AOPr4FUlmc0PyOxTNnPqm2MdSOLmuIhA32+yqU88xd9c/xlz+3y7hCEE5zGjnC5gFRhaa4iDePM= X-Received: by 10.157.14.182 with SMTP id 51mr13777613otj.158.1460830896523; Sat, 16 Apr 2016 11:21:36 -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 xm14sm16786281oeb.17.2016.04.16.11.21.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 Apr 2016 11:21:35 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Sat, 16 Apr 2016 13:21:33 -0500 Message-Id: <1460830893-22902-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 X-Topics: patch Subject: [lng-odp] [PATCHv2] 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, free 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..3ddbc72 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)) { + queue->s.status = QUEUE_STATUS_FREE; ODP_ERR("schedule queue init failed\n"); return ODP_QUEUE_INVALID; }