]> git.baikalelectronics.ru Git - kernel.git/commit
fm10k: prevent null pointer dereference of msix_entries table
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 4 Feb 2016 18:47:54 +0000 (10:47 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 5 Apr 2016 19:48:55 +0000 (12:48 -0700)
commitccd79e59f8e6e377a2467bc76bc3891dcead6130
tree8beeac9f412eb038b83e2e35900073ddc01b550e
parent10198e730b9d0fd6be436e4577c95e59d2ff40ce
fm10k: prevent null pointer dereference of msix_entries table

According to the C standard dereferencing a variable before it is
checked invokes undefined behavior, and thus compilers are free to
assume the check for NULL isn't necessary. Prevent this by re-ordering
the NULL check of msix_entries in fm10k_free_mbx_irq.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/fm10k/fm10k_pci.c