[Intel-wired-lan] [next PATCH S5 iavf 02/11] iavf: use signed variable
Bowers, AndrewX
andrewx.bowers at intel.com
Fri May 17 22:24:58 UTC 2019
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Tuesday, May 14, 2019 10:37 AM
> To: Michael, Alice <alice.michael at intel.com>; intel-wired-
> lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S5 iavf 02/11] iavf: use signed variable
>
> From: Mitch Williams <mitch.a.williams at intel.com>
>
> The counter variable in iavf_clean_tx_irq starts out negative and climbs to 0.
> So allocating it as u16 is actually a really bad idea that just happens to work
> because the value underflows and overflows consistently on most
> architectures.
>
> Replace the u16 with an int so signed math works as expected.
>
> Signed-off-by: Mitch Williams <mitch.a.williams at intel.com>
> ---
> drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Tested-by: Andrew Bowers <andrewx.bowers at intel.com>
More information about the Intel-wired-lan
mailing list