> -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;
>  }

Reply via email to