From patchwork Thu Sep 3 15:16:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 53033 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 262D222E23 for ; Thu, 3 Sep 2015 15:20:23 +0000 (UTC) Received: by lagj9 with SMTP id j9sf18122400lag.0 for ; Thu, 03 Sep 2015 08:20:22 -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=EE+Z9zxF1uESfiUgvFHcaClz69OY88dDv09zOf7UKgo=; b=lPhbME13CnbmqVkbPOi5l/vpakguWLfl58YCui0hKUolVtZrzxQDKoK03SEtTpVH7h TK6cJd/GWzhurliGU0zf3umnFA5Xlsb8GDjp+/GWw+P1wWnmrrPCQCz7qruHoUR57C6R /li2It+tCTA4B1KwbNw8nfuu+Z7SQn53nuZjLziJgYyM94RRXsjobjJ+8gbLikWEVo9Q Ep3Tsw7gdPBW8gfbBhyWHEK3LMHyM8epniDdnRAP/5JrYDHThm6LlEEg06BI1KKjjxEm eKf//wVX/Z4e9+gXsID6xS51wBKP6UrwJxxVT+vHiwOCTwXIMvHu8YqISLmX1SFosYog o6Sg== X-Gm-Message-State: ALoCoQlJNgaS60RzTHX1P4TPwHzCrcSk+HIuK4YdUnf+vWmyVSSCDygU7VctESIm/UCdqanhdNow X-Received: by 10.180.100.71 with SMTP id ew7mr2783728wib.0.1441293622208; Thu, 03 Sep 2015 08:20:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.18.137 with SMTP id w9ls208119lad.102.gmail; Thu, 03 Sep 2015 08:20:22 -0700 (PDT) X-Received: by 10.112.130.97 with SMTP id od1mr21746118lbb.37.1441293622047; Thu, 03 Sep 2015 08:20:22 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id d1si23383091laa.119.2015.09.03.08.20.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Sep 2015 08:20:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbcjc2 with SMTP id jc2so26327225lbc.0 for ; Thu, 03 Sep 2015 08:20:21 -0700 (PDT) X-Received: by 10.152.178.165 with SMTP id cz5mr15667363lac.29.1441293621720; Thu, 03 Sep 2015 08:20:21 -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 yn10csp1344109lbb; Thu, 3 Sep 2015 08:20:18 -0700 (PDT) X-Received: by 10.140.101.119 with SMTP id t110mr7254036qge.71.1441293618631; Thu, 03 Sep 2015 08:20:18 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f74si30221155qhc.70.2015.09.03.08.20.17; Thu, 03 Sep 2015 08:20:18 -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 EE91D61A2B; Thu, 3 Sep 2015 15:20:16 +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 260F761A2A; Thu, 3 Sep 2015 15:17:30 +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 BABFD61A36; Thu, 3 Sep 2015 15:17:25 +0000 (UTC) Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by lists.linaro.org (Postfix) with ESMTPS id 9878F61A2A for ; Thu, 3 Sep 2015 15:16:50 +0000 (UTC) Received: by obqa2 with SMTP id a2so35061284obq.3 for ; Thu, 03 Sep 2015 08:16:50 -0700 (PDT) X-Received: by 10.60.124.230 with SMTP id ml6mr5664479oeb.81.1441293410022; Thu, 03 Sep 2015 08:16:50 -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 e73sm1525294oib.3.2015.09.03.08.16.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Sep 2015 08:16:49 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org, maxim.uvarov@linaro.org Date: Thu, 3 Sep 2015 10:16:37 -0500 Message-Id: <1441293400-28777-6-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441293400-28777-1-git-send-email-bill.fischofer@linaro.org> References: <1441293400-28777-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 5/8] 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.217.171 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 46b3371..87483b9 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -325,7 +325,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);