]> git.baikalelectronics.ru Git - kernel.git/commit
iavf: fix dereference of null rx_buffer pointer
authorColin Ian King <colin.king@canonical.com>
Wed, 19 Jun 2019 14:30:44 +0000 (15:30 +0100)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 28 Jun 2019 23:00:10 +0000 (16:00 -0700)
commitc8a464a98d00e02b585923b404374835549ed925
tree5af0454ba2e181d1cd391fda6ac1941a5cd854fe
parentf0c226b20db52ec2281df83097eec9b2551bf47e
iavf: fix dereference of null rx_buffer pointer

A recent commit 97d5336740c484 ("iavf: allow null RX descriptors") added
a null pointer sanity check on rx_buffer, however, rx_buffer is being
dereferenced before that check, which implies a null pointer dereference
bug can potentially occur.  Fix this by only dereferencing rx_buffer
until after the null pointer check.

Addresses-Coverity: ("Dereference before null check")
Signed-off-by: Colin Ian King <colin.king@canonical.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