> From: David Harton (dharton) [mailto:dhar...@cisco.com] > Sent: Thursday, January 11, 2018 2:59 PM > To: Van Haaren, Harry <harry.van.haa...@intel.com>; Wu, Jingjing > <jingjing...@intel.com>; Xing, Beilei <beilei.x...@intel.com> > Cc: dev@dpdk.org; Zhao1, Wei <wei.zh...@intel.com> > Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix VF reset stats crash > > > > -----Original Message----- > > From: Van Haaren, Harry [mailto:harry.van.haa...@intel.com] > > > > > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of David C Harton > > > > > > Calling i40evf_dev_xstats_reset can sometimes crash. > > > > > > Fixed issue by adding a pstats NULL check. > > > > Perhaps add a note here, that the root cause of (pstats == NULL) is a > > valid error return from i40evf_query_stats(), if the vf command fails to > > execute. > > > > Hence, we are not hiding symptoms of a different issue here, this NULL > > check is required to validate the returned values. > > > > NULL is returned if the call fails. > If desired I can capture the return code and base the check off the rc > instead. > That's the pattern used in a couple other places.
If you prefer that implementation of the check, you can keep my Ack, I don't mind much. I reviewed as in my experience a NULL pointer can often be detected earlier, but that wasn't the case here. PS: Apologies I didn't reply to v2, was reading "up" and didn't check for newer..