From patchwork Wed May 25 23:37:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 68652 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp113402qge; Wed, 25 May 2016 16:45:55 -0700 (PDT) X-Received: by 10.140.131.134 with SMTP id 128mr6401766qhd.45.1464219955023; Wed, 25 May 2016 16:45:55 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id y2si10574833qhe.82.2016.05.25.16.45.54; Wed, 25 May 2016 16:45:55 -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 A755E6180F; Wed, 25 May 2016 23:45:54 +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_H2, 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 80EE561676; Wed, 25 May 2016 23:45:50 +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 EFEC7617F0; Wed, 25 May 2016 23:45:32 +0000 (UTC) Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com [209.85.218.44]) by lists.linaro.org (Postfix) with ESMTPS id 9A0BE617E6 for ; Wed, 25 May 2016 23:44:46 +0000 (UTC) Received: by mail-oi0-f44.google.com with SMTP id j1so99501729oih.3 for ; Wed, 25 May 2016 16:44:46 -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=bUwp0+goQLtrPIFgxtt2M06pu+9EfARrGb0yDU9sRh8=; b=jsvdgcmu0WrocS+Y3Dvs3491pb7onhQzU7GJO9NGXE15dU/wzdby4D9EogGdLUL1jC oXF3bySYrcR6eqlqx+RKEmPHF1jJox2D5fUQErysqnZuxQ6CZ4ZxFyK95y4WxZu0AdTx 11QfOWH6bJC2a89rw4sYLXnWdbsdfrC1AozVX9MnEeDNOMsUT824QkmQJLYOku7H2oXJ mGZqNdTz36NjUeI5wWUFpl3WWcbaWDQ+tdo5RaCu+VRV4/mdRqzQpT9lRDl4fyQkk8nQ F57sqvPmW6lHKi9O324fED/V4cW3lUeYbmp0yRoRpQHz6f+6NZoDeMv9Hm+nYw38XHPN LzMg== X-Gm-Message-State: ALyK8tL7EnP84aRNNJDaaxS+en1g3yyownLqPN/L1fRdQOLco1haTBmlbUS+uqfsbvLRJPyHe+A= X-Received: by 10.202.170.15 with SMTP id t15mr3541448oie.3.1464219439204; Wed, 25 May 2016 16:37:19 -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 l65sm5103562otc.28.2016.05.25.16.37.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 May 2016 16:37:18 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 25 May 2016 18:37:03 -0500 Message-Id: <1464219423-14977-11-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1464219423-14977-1-git-send-email-bill.fischofer@linaro.org> References: <1464219423-14977-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 10/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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c index f8995b4..51cfe67 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -2171,7 +2171,8 @@ static int tm_process_expired_timers(tm_system_t *tm_system, (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) + if (tm_queue_obj && + tm_queue_obj->timer_cancels_outstanding != 0) tm_queue_obj->timer_cancels_outstanding--; else printf("%s bad timer return\n", __func__);