]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fm10k: avoid possible null pointer dereference in fm10k_update_stats
authorJacob Keller <jacob.e.keller@intel.com>
Fri, 3 Jun 2016 22:42:12 +0000 (15:42 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 26 Feb 2017 06:04:16 +0000 (22:04 -0800)
commit13c47e6ddd6dba02719922e39a1dbb5838b628fc
tree660ecfbca15b6faa63eb2e9a7858b0e551ca95b0
parent4be12be34fae824209839f3ea84f56117414db37
fm10k: avoid possible null pointer dereference in fm10k_update_stats

It's currently possible for fm10k_update_stats to be called during the
window when we go down and the rings are removed. This can result in
a null pointer dereference. In fm10k_get_stats64 we work around this by
using ACCESS_ONCE and a null pointer check inside the loop. Use this
same flow in the fm10k_update_stats to avoid the potential null pointer.

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 b624714bc90064eeefd9ba7564e90865eef00421)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
drivers/net/ethernet/intel/fm10k/fm10k_pci.c