From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8D9D4A052A; Sat, 18 Jul 2020 09:27:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 798071C021; Sat, 18 Jul 2020 09:25:49 +0200 (CEST) Received: from mail-wm1-f100.google.com (mail-wm1-f100.google.com [209.85.128.100]) by dpdk.org (Postfix) with ESMTP id B3F371BFF0 for ; Sat, 18 Jul 2020 09:25:44 +0200 (CEST) Received: by mail-wm1-f100.google.com with SMTP id 17so20533532wmo.1 for ; Sat, 18 Jul 2020 00:25:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KyhbrQUfZU1Xldz+wj5uL3g0ADiX3FBeBvM7fXyTi9g=; b=SWbH5SDMSQ26Tq5aHCI2BE4wFuQIouUuiEPXBaH08Bp2EmEKcvD/8Jj3o+YuEDPiZ9 4PZF/ChA7vUhn3F0L5Yu/Nx1crwUUQ19QxyUt4MRFKg9smWQ64QHYoFLQEdIDCt3YVSM 7BDYBPMa+Ek4t42PDlW9KMbiECT/Btj5kEpyw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KyhbrQUfZU1Xldz+wj5uL3g0ADiX3FBeBvM7fXyTi9g=; b=Dss3iJ3fxqMNZlFl2iUT71IwfTS9iTeGR9dh5NDQcsO2yrUBpk1+gu3BhGql0RteY6 NCRdnYJZNGeQ2fR3OXX9GehqNJC9vfIW2buuAfYYRAwWcZNjzCWdsEaNGsqiON5Bkshb zXI1f5bUXS4+fWbJ1N9H6VmKe7YoW3H2nKdpwWlFw3+ajiESlix6SvLaMDRzLXl09jnl 0+qPLWR9JwwwIWMwsT6Cf1Ckaf7liCgVlAhH6Lwp2uUwdqadzQNReYKFWC/kXyAojipV /OwhF9SVeEuj4FMB12jFpzKbedydvVL5hnAzSP68S4aW1r/8mIYRgfvGbFv6+tu8D66q LNlw== X-Gm-Message-State: AOAM532Sk8cj8dEeEqMTQONSC8UX6YPKp0tom51SZCQTnSSwPczqqWwo +TUBTYEhPuy/p6lKiRzRNMBjc3o8uMA/UjWRDSh2JVaLLhG7ocSUE4WtHlIqV3Bkvo/a95Kx7VC RHf1kQ0YdV/txPD2KZnhZN4yXxVvoxUfg5dDiwFmUWCdG7qmgyejiqxHbCE9LVBnNZIjk0sSL/6 iYTA== X-Google-Smtp-Source: ABdhPJxTA36LdhnWWuoIs6nTJjcIkgHiwt/RQpCrC58IkVNbVrVRmlAm+ieDy2fSqxj1IyUmhyF9kUY+Sqsg X-Received: by 2002:a1c:a70d:: with SMTP id q13mr13348007wme.55.1595057144236; Sat, 18 Jul 2020 00:25:44 -0700 (PDT) Received: from localhost.localdomain ([192.19.223.252]) by smtp-relay.gmail.com with ESMTPS id g14sm34554wrb.16.2020.07.18.00.25.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Jul 2020 00:25:44 -0700 (PDT) X-Relaying-Domain: broadcom.com From: Ajit Khaparde To: dev@dpdk.org Cc: Kishore Padmanabha , Somnath Kotur , Michael Baucom Date: Sat, 18 Jul 2020 00:25:11 -0700 Message-Id: <20200718072515.62969-11-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20200718072515.62969-1-ajit.khaparde@broadcom.com> References: <20200717141451.11705-1-somnath.kotur@broadcom.com> <20200718072515.62969-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 10/14] net/bnxt: fix dereference of a null pointer X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kishore Padmanabha Avoid dereferencing a null pointer. Fixes: 313ac35ac701 ("net/bnxt: support ULP session manager init") Signed-off-by: Kishore Padmanabha Signed-off-by: Somnath Kotur Reviewed-by: Michael Baucom --- drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c b/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c index b2c8c349c..4df850f22 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c +++ b/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c @@ -120,9 +120,11 @@ ulp_mark_db_init(struct bnxt_ulp_context *ctxt) return 0; mem_error: - rte_free(mark_tbl->gfid_tbl); - rte_free(mark_tbl->lfid_tbl); - rte_free(mark_tbl); + if (mark_tbl) { + rte_free(mark_tbl->gfid_tbl); + rte_free(mark_tbl->lfid_tbl); + rte_free(mark_tbl); + } BNXT_TF_DBG(DEBUG, "Failed to allocate memory for mark mgr\n"); return -ENOMEM; } -- 2.21.1 (Apple Git-122.3)