From patchwork Thu May 26 15:14:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 68701 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp460733qge; Thu, 26 May 2016 08:19:19 -0700 (PDT) X-Received: by 10.55.188.193 with SMTP id m184mr9290155qkf.183.1464275959830; Thu, 26 May 2016 08:19:19 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c128si13379826qhd.10.2016.05.26.08.19.19; Thu, 26 May 2016 08:19:19 -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 7AF74617E1; Thu, 26 May 2016 15:19:19 +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 A1787617FC; Thu, 26 May 2016 15:16: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 2051C617E4; Thu, 26 May 2016 15:16:40 +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 3E021617E1 for ; Thu, 26 May 2016 15:14:54 +0000 (UTC) Received: by mail-oi0-f54.google.com with SMTP id j1so128952640oih.3 for ; Thu, 26 May 2016 08:14:54 -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=+nqobGdzvQAPFekNfhceRgtJ0k/5TA71r+2QJLZLLu0=; b=DKma/Ig1ox0G+Dg0KsqKOKtWER8kEZpC9p7YzrxOezNF2QHO90Z/mwSPI8Pn8eOXvJ FhqYAs1Y9qsn/6bN+nWAApwtOhzpKcOamzMFvko3ChEwJ3Oga6EEgAY0pHA9OOYY3+mC b4fw3kL2ihpjRpWSyzqmDA/oktDWsjUUhcBQ07qa7o8pyHyw/LbGTE8NEahYeJTGjIhm mCkq1I0jiVXvMgvR9BSkqM6zaYvN21ITAS9rQmru+qSJ39TLiw3SxaVpcplIATaLhhBw fqeLWUh9ELBXyxmHdKX+PngINACs0m+rVHUgLu1JypuvAN/F5Byofs9qKuzgZXWJxgM9 O/Aw== X-Gm-Message-State: ALyK8tLvtRLeLQfRRCKGzG8xOEibTPVo/vbVoJWmumZKUY6yxxdGkNFbtDr3wnIolTC8q+nqOoE= X-Received: by 10.202.207.213 with SMTP id f204mr6353602oig.21.1464275693757; Thu, 26 May 2016 08:14:53 -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.14.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 May 2016 08:14:53 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 26 May 2016 10:14:41 -0500 Message-Id: <1464275685-18426-7-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 06/10] validation: 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 --- test/validation/traffic_mngr/traffic_mngr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/validation/traffic_mngr/traffic_mngr.c b/test/validation/traffic_mngr/traffic_mngr.c index 82d74db..da0fac5 100644 --- a/test/validation/traffic_mngr/traffic_mngr.c +++ b/test/validation/traffic_mngr/traffic_mngr.c @@ -1376,7 +1376,7 @@ static tm_node_desc_t *create_tm_node(odp_tm_t odp_tm, } /* Now connect this node to the lower level "parent" node. */ - if (level == 0) + if (level == 0 || !parent_node_desc) parent_node = ODP_TM_ROOT; else parent_node = parent_node_desc->node;