From patchwork Thu Sep 3 00:07:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 53001 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id C43A223002 for ; Thu, 3 Sep 2015 00:10:08 +0000 (UTC) Received: by lamp12 with SMTP id p12sf9043765lam.2 for ; Wed, 02 Sep 2015 17:10:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=ymf/b0XpPNIcYiVVl5+yFaSzV1SfvsFQpcIn9IHN3sk=; b=KE4cjHr4L5gUwgeuHwxXq60Y5uC9Ws4H4GRXYeX8E8l1+0d/qH5rv3VECzXhse7/3w WJHG1kkzD0GG/DO8qTNWfDqID9OsXwoHbF7ZQobTOi+HwJ1cSmxdv7dj6QHcPSZ7fZGx noN+mv2GwtdQy+Sg5X/TDBsZ5gDN82UnRDOrM9Tz4cfmU/HASTzby4/xjmwooyrCMs0/ 6nmdttPAjlpi6a/vKY0AVPKbJriq06BAuupuuQGBT2q6FC4jPgQjCeSyNuV0GnXacz4F JBJWiIoe82VPJQMTBg7bFi9mLIHkd6eXFe0pDvfC9OOXgiC8GpXndKTQ9S8G2kO5SZ2X nmYg== X-Gm-Message-State: ALoCoQnbr86yA/GUsCy5GnAUOfwEtvwcuXZlY4y+cYWpUQLKAYEwWDjUcxkB+EKwfRb8KAjAIpIE X-Received: by 10.112.135.104 with SMTP id pr8mr9982721lbb.4.1441239007745; Wed, 02 Sep 2015 17:10:07 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.219.4 with SMTP id pk4ls151459lac.90.gmail; Wed, 02 Sep 2015 17:10:07 -0700 (PDT) X-Received: by 10.152.44.232 with SMTP id h8mr18480769lam.104.1441239007464; Wed, 02 Sep 2015 17:10:07 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id r5si21386040lbw.126.2015.09.02.17.10.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2015 17:10:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lagj9 with SMTP id j9so18257545lag.2 for ; Wed, 02 Sep 2015 17:10:07 -0700 (PDT) X-Received: by 10.112.166.2 with SMTP id zc2mr18265430lbb.29.1441239007046; Wed, 02 Sep 2015 17:10:07 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.164.42 with SMTP id yn10csp910086lbb; Wed, 2 Sep 2015 17:10:05 -0700 (PDT) X-Received: by 10.140.216.194 with SMTP id m185mr64354217qhb.98.1441239005449; Wed, 02 Sep 2015 17:10:05 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id x48si9328345qgx.56.2015.09.02.17.10.04; Wed, 02 Sep 2015 17:10:05 -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; Received: by lists.linaro.org (Postfix, from userid 109) id 7551961A06; Thu, 3 Sep 2015 00:10:04 +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 CA92761A1A; Thu, 3 Sep 2015 00:07:44 +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 AAB0661A0A; Thu, 3 Sep 2015 00:07:32 +0000 (UTC) Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com [209.85.214.181]) by lists.linaro.org (Postfix) with ESMTPS id 9CE1D619EC for ; Thu, 3 Sep 2015 00:07:29 +0000 (UTC) Received: by obcts10 with SMTP id ts10so22403989obc.1 for ; Wed, 02 Sep 2015 17:07:29 -0700 (PDT) X-Received: by 10.182.120.100 with SMTP id lb4mr22968064obb.71.1441238849162; Wed, 02 Sep 2015 17:07:29 -0700 (PDT) Received: from Ubuntu15.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by smtp.gmail.com with ESMTPSA id k5sm15601814oev.16.2015.09.02.17.07.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Sep 2015 17:07:28 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org, maxim.uvarov@linaro.org Date: Wed, 2 Sep 2015 19:07:19 -0500 Message-Id: <1441238841-25105-6-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441238841-25105-1-git-send-email-bill.fischofer@linaro.org> References: <1441238841-25105-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 5/7] linux-generic: queue: prevent lookup of destroyed queues X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bill.fischofer@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 odp_queue_lookup() should not be able to find queues in the transient state QUEUE_STATUS_DESTOYED Signed-off-by: Bill Fischofer --- platform/linux-generic/odp_queue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c index 87c5f91..7b7cb0a 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -324,7 +324,8 @@ odp_queue_t odp_queue_lookup(const char *name) for (i = 0; i < ODP_CONFIG_QUEUES; i++) { queue_entry_t *queue = &queue_tbl->queue[i]; - if (queue->s.status == QUEUE_STATUS_FREE) + if (queue->s.status == QUEUE_STATUS_FREE || + queue->s.status == QUEUE_STATUS_DESTROYED) continue; LOCK(&queue->s.lock);