[PATCH v4 03/10] net/cpfl: refine handle virtual channel message

Wu, Jingjing jingjing.wu at intel.com
Sat Sep 9 04:13:04 CEST 2023


> -static struct idpf_vport *
> +static struct cpfl_vport *
>  cpfl_find_vport(struct cpfl_adapter_ext *adapter, uint32_t vport_id)
>  {
> -	struct idpf_vport *vport = NULL;
> +	struct cpfl_vport *vport = NULL;
>  	int i;
> 
>  	for (i = 0; i < adapter->cur_vport_nb; i++) {
> -		vport = &adapter->vports[i]->base;
> -		if (vport->vport_id != vport_id)
> +		vport = adapter->vports[i];
> +		if (vport->base.vport_id != vport_id)
Check if vport is NULL to ensure the structure access?
>  			continue;
>  		else
>  			return vport;
>  	}
> 
> -	return vport;
> +	return NULL;
>  }


More information about the dev mailing list