From patchwork Wed May 25 23:36:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 68656 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp119983qge; Wed, 25 May 2016 17:07:16 -0700 (PDT) X-Received: by 10.55.48.75 with SMTP id w72mr6349321qkw.168.1464221236754; Wed, 25 May 2016 17:07:16 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j52si10702656qta.51.2016.05.25.17.07.10; Wed, 25 May 2016 17:07:16 -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 CC541617F7; Thu, 26 May 2016 00:07:10 +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 93939616CA; Thu, 26 May 2016 00:07:06 +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 135FB616F6; Thu, 26 May 2016 00:07:04 +0000 (UTC) Received: from mail-ob0-f170.google.com (mail-ob0-f170.google.com [209.85.214.170]) by lists.linaro.org (Postfix) with ESMTPS id 68A1A6160E for ; Thu, 26 May 2016 00:07:03 +0000 (UTC) Received: by mail-ob0-f170.google.com with SMTP id w8so2142652obe.2 for ; Wed, 25 May 2016 17:07:03 -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=bnUCI/WBt+Ei1sUGq0CShuHI/l2/mZeVOyOdXPnlClk=; b=RE/wY82dZitXsQQ4arZ2ACD+6ugm97YyMaFKFmDbGmW+bXTv3mn2HZMFyB5GSp1Ntu 4lHzESCEID8JR6tmaE9zG9TiUe4HhH3ewOp87U232ggaV3RYxpYse5XE9T8lLYFvMcvy FnZOwnfRxF1bj/uK6O5fj30E9hNRUXg7Il1JhZ4/jLyPogu815m+Wnil9uKDc19g1ivB PgoK3oMSt3qSJxqBOp2Pk8OGQDyM2G568fS9jLF7A25qnOsPP2NLvS6GqsE0Jojux0+0 mmfHviGk+2jM+GS9WT1PVx+bw1rT3aRK9g2RI9b+bjwCTENJ5fi0jo/RXLMAAlXQml/m gTWg== X-Gm-Message-State: ALyK8tJGXNDSNwcoTBBIzvF0wLOdsRoUG9Ggh5z674y9a/yyyx0MyRZ2Ffk1qP6TYNFdewAtUZg= X-Received: by 10.157.4.231 with SMTP id 94mr4301110otm.122.1464219436274; Wed, 25 May 2016 16:37:16 -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.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 May 2016 16:37:15 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 25 May 2016 18:36:59 -0500 Message-Id: <1464219423-14977-7-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 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 6b845b7..10ca2fe 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;