]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 26 Feb 2017 06:03:53 +0000 (22:03 -0800)
commit161fba668799df6d7cadbc1c31924ee96172a7c9
treee4756874c44a6427750c4075b16868a6a644a588
parent5494459fd43fdcccb734885d9b042d2949dfdcfc
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>
Orabug: 25394529
(cherry picked from commit de66c610a6adade32bf955f67b4f4f4aaeeeff85)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
drivers/net/ethernet/intel/fm10k/fm10k_pci.c