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)
commitde66c610a6adade32bf955f67b4f4f4aaeeeff85
tree8beeac9f412eb038b83e2e35900073ddc01b550e
parent11c49f79b294081010f7e13a95c6b40c4d36b1de
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