[PATCH] net/netvsc: fix bogus sizeof calculation

Tyler Retzlaff roretzla at linux.microsoft.com
Thu Jun 29 17:51:36 CEST 2023


On Wed, Jun 28, 2023 at 05:29:57PM -0700, longli at linuxonhyperv.com wrote:
> From: Stephen Hemminger <stephen at networkplumber.org>
> 
> Found by cppcheck.
> 
> drivers/net/netvsc/hn_rndis.c:332:21: warning: Found calculation inside sizeof(). [sizeofCalculation]  if (len < sizeof(3 * sizeof(uint32_t))) {
> 
> Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> Signed-off-by: Long Li <longli at microsoft.com>
> ---

Acked-by: Tyler Retzlaff <roretzla at linux.microsoft.com>



More information about the dev mailing list