From patchwork Thu May 26 15:14:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 68705 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp461766qge; Thu, 26 May 2016 08:21:14 -0700 (PDT) X-Received: by 10.55.22.94 with SMTP id g91mr2025211qkh.101.1464276074685; Thu, 26 May 2016 08:21:14 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id s53si13376314qtb.79.2016.05.26.08.21.14; Thu, 26 May 2016 08:21:14 -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 64879617DE; Thu, 26 May 2016 15:21:14 +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 A1AA2617EA; Thu, 26 May 2016 15:17:23 +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 C26EF61800; Thu, 26 May 2016 15:17:18 +0000 (UTC) Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com [209.85.218.51]) by lists.linaro.org (Postfix) with ESMTPS id DFBF5617EC for ; Thu, 26 May 2016 15:15:01 +0000 (UTC) Received: by mail-oi0-f51.google.com with SMTP id b65so129131564oia.1 for ; Thu, 26 May 2016 08:15:01 -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=Ku8HepA95Sn9at/5w08vhI5hOaNlkkTFwMIOg8+xkKLJIfXyJcr0MeQEVZOHoKaM5X B+gadAK5ACRTjLCP2G/F6BAUUBOqIUzd/tjoovvGFqkMmVWnmeDPPjS5vOmqRXLUuPTP mnGfdcHZ/qMTes+LnqcNgRUU6H3Xoj7lT/ekCN4QacjZB794cZxV4WD5nMQdK3as8ds2 5EwGvgh/OzZTDD38aJL9vboabKA/6+cYYezG5uj87XR4yGrW9l/wZ14wtDxUyOZqd2cj PeM/fvTyr/qHZxL4uh8gfEQxr/7KueEA11MfLNbuXCl9MrJnEFSBL3dqrSnQjr8b/eVt MfFA== X-Gm-Message-State: ALyK8tJKw/EjNvkdKyKWU5WTWfFPWylRFyTkJBnmITRSV5Y1+DYLIWlwW3pOVbBYTJedAzZ2rDM= X-Received: by 10.157.45.12 with SMTP id v12mr6604128ota.106.1464275701375; Thu, 26 May 2016 08:15:01 -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 60sm6646041ott.13.2016.05.26.08.15.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 May 2016 08:15:00 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 26 May 2016 10:14:45 -0500 Message-Id: <1464275685-18426-11-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1464275685-18426-1-git-send-email-bill.fischofer@linaro.org> References: <1464275685-18426-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 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__);