]> git.baikalelectronics.ru Git - kernel.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)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 20 Jul 2016 22:22:09 +0000 (15:22 -0700)
commit7337afeeb768dc59b9fc3d8f3121c137ca3bab4b
tree3cb5a3c9a916c1e2d31fd3df993399d7471e9810
parent68deae26e188c8c566544c2688dbbc860b27ae73
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>
drivers/net/ethernet/intel/fm10k/fm10k_pci.c