[PATCH] net: thunderx: correct bound check in nic_config_loopback

Levin, Alexander alexander.levin at verizon.com
Mon Aug 1 08:57:58 PDT 2016


On 07/31/2016 12:41 PM, Sunil Kovvuri wrote:
> Thanks for finding.
> A much better fix would be,
> 
> -       if (lbk->vf_id > MAX_LMAC)
> +       if (lbk->vf_id >= nic->num_vf_en)
>                 return -1;
> 
> where 'num_vf_en' reflects the exact number of physical interfaces or
> LMACs on the system.

Right. I see quite a few more places that compare to MAX_LMAC vs
num_vf_en. What was the reasoning behind it then?


Thanks,
Sasha


More information about the linux-arm-kernel mailing list