]> git.baikalelectronics.ru Git - kernel.git/commit
iavf: use signed variable
authorMitch Williams <mitch.a.williams@intel.com>
Tue, 14 May 2019 17:37:00 +0000 (10:37 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 17 Jun 2019 22:39:25 +0000 (15:39 -0700)
commit7ef0bd3963f434910aa95f653be04ac69334acb6
treeb4c0ad5031fa5a6c36e16d976315f488d9c31fee
parent97084a89902c6214d05234e3e94d0e6737fb6c91
iavf: use signed variable

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@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/iavf/iavf_txrx.c