From patchwork Thu May 26 23:46:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 68723 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp659376qge; Thu, 26 May 2016 16:50:38 -0700 (PDT) X-Received: by 10.55.123.130 with SMTP id w124mr11781681qkc.164.1464306638566; Thu, 26 May 2016 16:50:38 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id t79si5910781qgd.32.2016.05.26.16.50.38; Thu, 26 May 2016 16:50:38 -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 2100067442; Thu, 26 May 2016 23:50:38 +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 0E8F967463; Thu, 26 May 2016 23:48:10 +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 89BED67454; Thu, 26 May 2016 23:48:03 +0000 (UTC) Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com [209.85.218.54]) by lists.linaro.org (Postfix) with ESMTPS id 9110967454 for ; Thu, 26 May 2016 23:47:05 +0000 (UTC) Received: by mail-oi0-f54.google.com with SMTP id w184so142537300oiw.2 for ; Thu, 26 May 2016 16:47:05 -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:in-reply-to :references; bh=pk6KivD/g/8H0sV4qZFnJSIVsbWrF6Jw42LktVYLbbE=; b=KsAog63RYDtVI6ppraGUREKnhB4e9BlYHgXWvCqaVWCmhAEZU+RDHcYN1Ovp0xygNb /trfkRRRYxylJNBphkXyArV6CAUbHMe3ftZlytqL8Ge25gv1KU37re+wjkUIn+ICAcQ0 Di7u3pCjj7vgmV3/DW0qeDtYA85HVkc7Yg4L6WkuaNin6JL78Ju4U7OTFNRScmCYY4IC eRZccuqImbVKB+1vEjczDFdGfKSZ5AY09H5iK5xdZ9q++4phEuSI1fYo3OkborUIc8/R PAEDtxnLf7wACEg5Sg0UVN7JTuZ/6LgZcAQHmjpe1GGYsIGW/LUNg59AW7yO8wp7MiKj Fs0A== X-Gm-Message-State: ALyK8tIRBBpezSrtuld8SDUf9xCFo1zMCIFnM4pG5p+OoUir768hm5t9seWMP0x2pjhm4EVqyHc= X-Received: by 10.157.48.89 with SMTP id w25mr7567057otd.32.1464306424394; Thu, 26 May 2016 16:47:04 -0700 (PDT) Received: from localhost.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id c7sm7720581oia.8.2016.05.26.16.47.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 May 2016 16:47:03 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 26 May 2016 18:46:48 -0500 Message-Id: <1464306409-7325-10-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1464306409-7325-1-git-send-email-bill.fischofer@linaro.org> References: <1464306409-7325-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv3 09/10] linux-generic: tm: avoid potential null pointer dereference 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" Signed-off-by: Bill Fischofer --- platform/linux-generic/odp_traffic_mngr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c index f8995b4..db74ceb 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -2167,8 +2167,10 @@ static int tm_process_expired_timers(tm_system_t *tm_system, timer_seq = timer_context >> 32; tm_queue_obj = tm_system->queue_num_tbl[queue_num]; - if ((!tm_queue_obj) || - (tm_queue_obj->timer_reason == NO_CALLBACK) || + if (!tm_queue_obj) + return work_done; + + if ((tm_queue_obj->timer_reason == NO_CALLBACK) || (!tm_queue_obj->timer_shaper) || (tm_queue_obj->timer_seq != timer_seq)) { if (tm_queue_obj->timer_cancels_outstanding != 0)