On Wed, 24 Sep 2025 16:23:31 +0800
Tianhao Zhang <[email protected]> wrote:
> +static void
> +zxdh_priv_res_free(struct zxdh_hw *priv)
> +{
> + rte_free(priv->vfinfo);
> + priv->vfinfo = NULL;
> + if (priv->channel_context != NULL) {
> + rte_free(priv->channel_context);
> + priv->channel_context = NULL;
> + }
> +}
> +
You don't need the check for channel_context.
It is better to make both pieces consistent:
Like:
static void
zxdh_priv_res_free(struct zxdh_hw *priv)
{
rte_free(priv->vfinfo);
priv->vfinfo = NULL;
rte_free(priv->channel_context);
priv->channel_context = NULL;
}