From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 53C11A0547 for ; Mon, 24 May 2021 10:59:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 47D9D4003E; Mon, 24 May 2021 10:59:21 +0200 (CEST) Received: from proxy.6wind.com (host.78.145.23.62.rev.coltfrance.com [62.23.145.78]) by mails.dpdk.org (Postfix) with ESMTP id 880B14003E; Mon, 24 May 2021 10:59:20 +0200 (CEST) Received: from localhost (unknown [10.16.0.39]) by proxy.6wind.com (Postfix) with ESMTP id 722459B479F; Mon, 24 May 2021 10:59:20 +0200 (CEST) From: Thierry Herbelot To: dev@dpdk.org Cc: Thierry Herbelot , Thomas Monjalon , stable@dpdk.org, Gagandeep Singh Date: Mon, 24 May 2021 10:59:17 +0200 Message-Id: <20210524085917.16254-1-thierry.herbelot@6wind.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] net/pfe: do not use a possibly NULL Pointer X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Use dev only after it was checked not to be NULL. Fixes: acd4818ea2a45 ("net/pfe: add link status update") Cc: stable@dpdk.org Cc: Gagandeep Singh Signed-off-by: Thierry Herbelot --- drivers/net/pfe/pfe_ethdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c index 3135466713fb..09048e57d973 100644 --- a/drivers/net/pfe/pfe_ethdev.c +++ b/drivers/net/pfe/pfe_ethdev.c @@ -578,7 +578,7 @@ static int pfe_eth_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused) { int ret, ioctl_cmd = 0; - struct pfe_eth_priv_s *priv = dev->data->dev_private; + struct pfe_eth_priv_s *priv; struct rte_eth_link link, old; unsigned int lstatus = 1; @@ -586,6 +586,7 @@ pfe_eth_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused) PFE_PMD_ERR("Invalid device in link_update.\n"); return 0; } + priv = dev->data->dev_private; memset(&old, 0, sizeof(old)); memset(&link, 0, sizeof(struct rte_eth_link)); -- 2.29.2