ice: set tx_tstamps when creating new Tx rings via ethtool
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 27 Jul 2022 23:15:57 +0000 (16:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:32 +0000 (12:35 +0200)
commit624f03a027f2b18647cc4f1a7a81920a1e4e0201
treed99cadefd125b35c1a6bd2a0672e595df648396c
parent2e52d858de3a77f447c1636c2a9c3e64ab4eff91
ice: set tx_tstamps when creating new Tx rings via ethtool

[ Upstream commit b3b173745c8cab1e24d6821488b60abed3acb24d ]

When the user changes the number of queues via ethtool, the driver
allocates new rings. This allocation did not initialize tx_tstamps. This
results in the tx_tstamps field being zero (due to kcalloc allocation), and
would result in a NULL pointer dereference when attempting a transmit
timestamp on the new ring.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ice/ice_ethtool.c