From patchwork Mon Mar 16 13:58:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Haslam X-Patchwork-Id: 45852 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 61D9C21547 for ; Mon, 16 Mar 2015 13:58:46 +0000 (UTC) Received: by wggy19 with SMTP id y19sf26735772wgg.2 for ; Mon, 16 Mar 2015 06:58:45 -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:from:to:date:message-id: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=SUKUIfChC3IiErM/5110eUsvVftco0ZdgN1DL4Yep/E=; b=aKra0c3PnZJLB/RqWCeCbgQ5yfZNUX/JBqge7xtKmB03QJkhDvEPbyhI6Kvw1KHNTj pI7srBgmUm2dy5/JGtDV59Mrrxp+LOA51QP7sX0XvaTDm2pi4zdvbEwtYTS3lYCkbjCw XBm59YoJaIdVeTl4EhwIRqG426vHaceaogQLdHXWevBSHwjTzo8XoXeEYbUyEv/mP0y+ hoSI84Ue5WQ7Y/M7dIfdI/ROse8PSpu96yJXrhf4noN5aobp11nl5L5Fwnn3/+AvkEfU u8Fh39PQxoCZKm3vDvyOQPSHe30rLeMv0d7ibj08SlUWRgKuA/X1qFb7kOzuFoxPjwvN k06g== X-Gm-Message-State: ALoCoQk3bWn35WwcMvmPI+NG5JVcJ9iw39Ijly3emjjYXRbN5kXPppJZKo9mlntpY8lOyYzyFo97 X-Received: by 10.180.101.101 with SMTP id ff5mr12410346wib.5.1426514325712; Mon, 16 Mar 2015 06:58:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.68 with SMTP id y4ls693591lay.12.gmail; Mon, 16 Mar 2015 06:58:45 -0700 (PDT) X-Received: by 10.152.87.46 with SMTP id u14mr34987153laz.82.1426514325408; Mon, 16 Mar 2015 06:58:45 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id w3si8202827lag.108.2015.03.16.06.58.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Mar 2015 06:58:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by labjg1 with SMTP id jg1so40493416lab.2 for ; Mon, 16 Mar 2015 06:58:45 -0700 (PDT) X-Received: by 10.152.178.197 with SMTP id da5mr56884893lac.56.1426514325280; Mon, 16 Mar 2015 06:58:45 -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.35.133 with SMTP id h5csp2601813lbj; Mon, 16 Mar 2015 06:58:44 -0700 (PDT) X-Received: by 10.55.31.168 with SMTP id n40mr71101152qkh.12.1426514324108; Mon, 16 Mar 2015 06:58:44 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id f35si9984947qki.85.2015.03.16.06.58.41 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Mar 2015 06:58:44 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YXVXS-0007x6-Bq; Mon, 16 Mar 2015 13:58:38 +0000 Received: from mail-we0-f172.google.com ([74.125.82.172]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YXVXF-0007wl-Fu for lng-odp@lists.linaro.org; Mon, 16 Mar 2015 13:58:25 +0000 Received: by wegp1 with SMTP id p1so38909021weg.1 for ; Mon, 16 Mar 2015 06:58:20 -0700 (PDT) X-Received: by 10.194.90.7 with SMTP id bs7mr86509118wjb.7.1426514299828; Mon, 16 Mar 2015 06:58:19 -0700 (PDT) Received: from e106441.cambridge.arm.com ([2001:41d0:a:3cb4::1]) by mx.google.com with ESMTPSA id lj13sm15507576wic.9.2015.03.16.06.58.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Mar 2015 06:58:18 -0700 (PDT) From: Stuart Haslam To: lng-odp@lists.linaro.org Date: Mon, 16 Mar 2015 13:58:01 +0000 Message-Id: <1426514281-29774-1-git-send-email-stuart.haslam@linaro.org> X-Mailer: git-send-email 2.1.1 X-Topics: patch Subject: [lng-odp] [PATCH] linux-generic: queue: fix potential queue leak X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stuart.haslam@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.43 as permitted sender) smtp.mail=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 If schedule buffer allocation fails during odp_queue_create(), a scheduled or pktin queue may be incorrectly left in an allocated state. Signed-off-by: Stuart Haslam Reviewed-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 477b5e3..4bb8b9b 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -226,6 +226,7 @@ odp_queue_t odp_queue_create(const char *name, odp_queue_type_t type, buf = odp_schedule_buffer_alloc(handle); if (buf == ODP_BUFFER_INVALID) { + queue->s.status = QUEUE_STATUS_FREE; ODP_ERR("queue_init: sched buf alloc failed\n"); return ODP_QUEUE_INVALID; }