From mboxrd@z Thu Jan 1 00:00:00 1970 From: David C Harton Subject: [PATCH] net/i40e: fix VF reset stats crash Date: Thu, 11 Jan 2018 08:23:37 -0500 Message-ID: <20180111132337.14389-1-dharton@cisco.com> Cc: dev@dpdk.org, David C Harton , wei.zhao1@intel.com To: jingjing.wu@intel.com, beilei.xing@intel.com Return-path: Received: from alln-iport-6.cisco.com (alln-iport-6.cisco.com [173.37.142.93]) by dpdk.org (Postfix) with ESMTP id 6A9CF44BE for ; Thu, 11 Jan 2018 14:23:57 +0100 (CET) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Calling i40evf_dev_xstats_reset can sometimes crash. Fixed issue by adding a pstats NULL check. Fixes: da61cd0849766 ("i40evf: add extended stats") 8210e9e0d805e ("net/i40e: fix clear xstats bug in VF") Cc: wei.zhao1@intel.com Signed-off-by: David C Harton --- drivers/net/i40e/i40e_ethdev_vf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index b96d77a..9c773fe 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -923,7 +923,8 @@ i40evf_dev_xstats_reset(struct rte_eth_dev *dev) i40evf_query_stats(dev, &pstats); /* set stats offset base on current values */ - vf->vsi.eth_stats_offset = *pstats; + if (pstats != NULL) + vf->vsi.eth_stats_offset = *pstats; } static int i40evf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, -- 2.10.3.dirty