[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202202211208.RSlRUGsa-lkp@intel.com>
Date: Mon, 21 Feb 2022 16:09:14 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: kbuild@...ts.01.org,
Maciej Fijalkowski <maciej.fijalkowski@...el.com>
Cc: lkp@...el.com, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org,
Tony Nguyen <anthony.l.nguyen@...el.com>
Subject: drivers/net/ethernet/intel/ice/ice_main.c:5677
ice_update_vsi_tx_ring_stats() error: we previously assumed 'ring' could be
null (see line 5673)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: cfb92440ee71adcc2105b0890bb01ac3cddb8507
commit: e72bba21355dbb67512a0d666fec9f4b56dbfc2f ice: split ice_ring onto Tx/Rx separate structs
config: ia64-randconfig-m031-20220220 (https://download.01.org/0day-ci/archive/20220221/202202211208.RSlRUGsa-lkp@intel.com/config)
compiler: ia64-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
smatch warnings:
drivers/net/ethernet/intel/ice/ice_main.c:5677 ice_update_vsi_tx_ring_stats() error: we previously assumed 'ring' could be null (see line 5673)
vim +/ring +5677 drivers/net/ethernet/intel/ice/ice_main.c
49d358e0e746dc Marta Plantykow 2020-05-15 5661 static void
e72bba21355dbb Maciej Fijalkowski 2021-08-19 5662 ice_update_vsi_tx_ring_stats(struct ice_vsi *vsi, struct ice_tx_ring **rings,
49d358e0e746dc Marta Plantykow 2020-05-15 5663 u16 count)
49d358e0e746dc Marta Plantykow 2020-05-15 5664 {
49d358e0e746dc Marta Plantykow 2020-05-15 5665 struct rtnl_link_stats64 *vsi_stats = &vsi->net_stats;
49d358e0e746dc Marta Plantykow 2020-05-15 5666 u16 i;
49d358e0e746dc Marta Plantykow 2020-05-15 5667
49d358e0e746dc Marta Plantykow 2020-05-15 5668 for (i = 0; i < count; i++) {
e72bba21355dbb Maciej Fijalkowski 2021-08-19 5669 struct ice_tx_ring *ring;
e72bba21355dbb Maciej Fijalkowski 2021-08-19 5670 u64 pkts = 0, bytes = 0;
49d358e0e746dc Marta Plantykow 2020-05-15 5671
49d358e0e746dc Marta Plantykow 2020-05-15 5672 ring = READ_ONCE(rings[i]);
e72bba21355dbb Maciej Fijalkowski 2021-08-19 @5673 if (ring)
^^^^
Check for NULL
e72bba21355dbb Maciej Fijalkowski 2021-08-19 5674 ice_fetch_u64_stats_per_ring(&ring->syncp, ring->stats, &pkts, &bytes);
49d358e0e746dc Marta Plantykow 2020-05-15 5675 vsi_stats->tx_packets += pkts;
49d358e0e746dc Marta Plantykow 2020-05-15 5676 vsi_stats->tx_bytes += bytes;
49d358e0e746dc Marta Plantykow 2020-05-15 @5677 vsi->tx_restart += ring->tx_stats.restart_q;
Unchecked dereferences on the following lines
49d358e0e746dc Marta Plantykow 2020-05-15 5678 vsi->tx_busy += ring->tx_stats.tx_busy;
49d358e0e746dc Marta Plantykow 2020-05-15 5679 vsi->tx_linearize += ring->tx_stats.tx_linearize;
49d358e0e746dc Marta Plantykow 2020-05-15 5680 }
49d358e0e746dc Marta Plantykow 2020-05-15 5681 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Powered by blists - more mailing lists