From patchwork Thu May 26 23:46:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 68722 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp659255qge; Thu, 26 May 2016 16:50:11 -0700 (PDT) X-Received: by 10.237.37.204 with SMTP id y12mr11203044qtc.72.1464306611768; Thu, 26 May 2016 16:50:11 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i62si15060718qkc.105.2016.05.26.16.50.11; Thu, 26 May 2016 16:50:11 -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 5360661714; Thu, 26 May 2016 23:50:11 +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 A02DA6745D; Thu, 26 May 2016 23:48:07 +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 3131D67462; Thu, 26 May 2016 23:47:56 +0000 (UTC) Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com [209.85.218.45]) by lists.linaro.org (Postfix) with ESMTPS id 14B0E67452 for ; Thu, 26 May 2016 23:47:03 +0000 (UTC) Received: by mail-oi0-f45.google.com with SMTP id w184so142536269oiw.2 for ; Thu, 26 May 2016 16:47: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=vVsXUtv0PWd9jX0a4U8vQ+kzveR58xwGnJI0d4ZaGJk=; b=gU/zDA20NbwDYblEt/Z4zctDCB1HosAN7g8nQdwxaIJiKgJQnHMlUbuD3W+2wlwWiM hh12kir6FIal0LJe1bRza8FFdM5W3gh+nyHFMIfuymq3ST+XZvqQTpMY6OIgIi6gTvfv +B0xAUeYGndESEu9etBwEBTyx3x6u9IVEf+0k1FBm4wTUX+NNSP/1QFP1jcIgj63l/w6 et2Q/dAfMDkDZ3lJOZeUKqJM7cJsjUxJmr7TpIzP2kMQ2qn/wXVZQ6xyT6eyOkEcHC4K gIOLkqArWmG8sNAvwA2YLlp52a83JKFwWAbSQZAidYA4HBuy+NkNaXdEyltgdhH+OYGA C37g== X-Gm-Message-State: ALyK8tK0jMJYtFtFCqKI82nmNydZaUi1J4rRDNbAwugwu8SX+UDlrVwa4yjKDy4kfVBlAQjMktQ= X-Received: by 10.202.180.84 with SMTP id d81mr7811904oif.29.1464306420420; Thu, 26 May 2016 16:47:00 -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.46.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 May 2016 16:46:59 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 26 May 2016 18:46:44 -0500 Message-Id: <1464306409-7325-6-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 05/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 e099083..bed2d2f 100644 --- a/test/validation/traffic_mngr/traffic_mngr.c +++ b/test/validation/traffic_mngr/traffic_mngr.c @@ -1374,7 +1374,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;