> From: Ferruh Yigit [mailto:ferruh.yi...@intel.com] > Sent: Thursday, March 02, 2017 5:05 AM > > On 2/27/2017 7:51 AM, Rasesh Mody wrote: > > Set pointers to NULL after freeing the allocations on ecore_resc_free(). > > > > Fixes: 26ae839d06e9 ("qede: add DCBX support") > > Fixes: ec94dbc57362 ("qede: add base driver") > > > > Signed-off-by: Rasesh Mody <rasesh.m...@cavium.com> > > --- > > drivers/net/qede/base/ecore_dcbx.c | 2 +- > > drivers/net/qede/base/ecore_dev.c | 4 ++-- > > drivers/net/qede/base/ecore_spq.c | 2 ++ > > 3 files changed, 5 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/net/qede/base/ecore_dcbx.c > > b/drivers/net/qede/base/ecore_dcbx.c > > index 7380fd8..9ce6dc4 100644 > > --- a/drivers/net/qede/base/ecore_dcbx.c > > +++ b/drivers/net/qede/base/ecore_dcbx.c > > @@ -914,7 +914,7 @@ enum _ecore_status_t > ecore_dcbx_info_alloc(struct > > ecore_hwfn *p_hwfn) void ecore_dcbx_info_free(struct ecore_hwfn > *p_hwfn, > > struct ecore_dcbx_info *p_dcbx_info) { > > - OSAL_FREE(p_hwfn->p_dev, p_hwfn->p_dcbx_info); > > + p_hwfn->p_dcbx_info = OSAL_NULL; > > > Is replacing free with "NULL assignment" intentional?
It was an oversight, good catch, incorporated in v2 series, thanks. > > From commit log and other updates in this patch, intention looks like > setting pointers to NULL after freeing them. > > > } > > > > static void ecore_dcbx_update_protocol_data(struct protocol_dcb_data > *p_data, > > diff --git a/drivers/net/qede/base/ecore_dev.c > b/drivers/net/qede/base/ecore_dev.c > > index 0518fc7..15051b6 100644 > > --- a/drivers/net/qede/base/ecore_dev.c > > +++ b/drivers/net/qede/base/ecore_dev.c > > @@ -156,6 +156,7 @@ void ecore_resc_free(struct ecore_dev *p_dev) > > p_dev->fw_data = OSAL_NULL; > > > > OSAL_FREE(p_dev, p_dev->reset_stats); > > + p_dev->reset_stats = OSAL_NULL; > > Since already a macro used for free, does it make sense to make NULL > assignment part of macro? Incorporated in v2 series.