All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: drivers/net/ethernet/intel/i40e/i40e_debugfs.c:582 i40e_dbg_dump_desc() error: uninitialized symbol 'ring'.
Date: Tue, 06 Oct 2020 15:45:18 +0300	[thread overview]
Message-ID: <20201006124518.GE4282@kadam> (raw)

[-- Attachment #1: Type: text/plain, Size: 4540 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   60e720931556fc1034d0981460164dcf02697679
commit: 44ea803e2fa7e12adb5d6260da4e4956e784effb i40e: introduce new dump desc XDP command
config: i386-randconfig-m021-20201001 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/net/ethernet/intel/i40e/i40e_debugfs.c:582 i40e_dbg_dump_desc() error: uninitialized symbol 'ring'.

vim +/ring +582 drivers/net/ethernet/intel/i40e/i40e_debugfs.c

02e9c290814cc14 Jesse Brandeburg 2013-09-11  541  static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
44ea803e2fa7e12 Ciara Loftus     2020-06-23  542  			       struct i40e_pf *pf, enum ring_type type)
02e9c290814cc14 Jesse Brandeburg 2013-09-11  543  {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  544  	bool is_rx_ring = type == RING_TYPE_RX;
68bf94aae1873cb Shannon Nelson   2014-01-15  545  	struct i40e_tx_desc *txd;
68bf94aae1873cb Shannon Nelson   2014-01-15  546  	union i40e_rx_desc *rxd;
e6c97234d1b18d4 Joe Perches      2014-11-18  547  	struct i40e_ring *ring;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  548  	struct i40e_vsi *vsi;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  549  	int i;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  550  
02e9c290814cc14 Jesse Brandeburg 2013-09-11  551  	vsi = i40e_dbg_find_vsi(pf, vsi_seid);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  552  	if (!vsi) {
7792fe4fd2f1fac Shannon Nelson   2013-11-26  553  		dev_info(&pf->pdev->dev, "vsi %d not found\n", vsi_seid);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  554  		return;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  555  	}
44ea803e2fa7e12 Ciara Loftus     2020-06-23  556  	if (type == RING_TYPE_XDP && !i40e_enabled_xdp_vsi(vsi)) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  557  		dev_info(&pf->pdev->dev, "XDP not enabled on VSI %d\n", vsi_seid);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  558  		return;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  559  	}
02e9c290814cc14 Jesse Brandeburg 2013-09-11  560  	if (ring_id >= vsi->num_queue_pairs || ring_id < 0) {
02e9c290814cc14 Jesse Brandeburg 2013-09-11  561  		dev_info(&pf->pdev->dev, "ring %d not found\n", ring_id);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  562  		return;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  563  	}
68bf94aae1873cb Shannon Nelson   2014-01-15  564  	if (!vsi->tx_rings || !vsi->tx_rings[0]->desc) {
29d0790ef3acd86 Shannon Nelson   2013-11-26  565  		dev_info(&pf->pdev->dev,
29d0790ef3acd86 Shannon Nelson   2013-11-26  566  			 "descriptor rings have not been allocated for vsi %d\n",
29d0790ef3acd86 Shannon Nelson   2013-11-26  567  			 vsi_seid);
29d0790ef3acd86 Shannon Nelson   2013-11-26  568  		return;
29d0790ef3acd86 Shannon Nelson   2013-11-26  569  	}
e6c97234d1b18d4 Joe Perches      2014-11-18  570  
44ea803e2fa7e12 Ciara Loftus     2020-06-23  571  	switch (type) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  572  	case RING_TYPE_RX:
44ea803e2fa7e12 Ciara Loftus     2020-06-23  573  		ring = kmemdup(vsi->rx_rings[ring_id], sizeof(*ring), GFP_KERNEL);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  574  		break;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  575  	case RING_TYPE_TX:
44ea803e2fa7e12 Ciara Loftus     2020-06-23  576  		ring = kmemdup(vsi->tx_rings[ring_id], sizeof(*ring), GFP_KERNEL);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  577  		break;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  578  	case RING_TYPE_XDP:
44ea803e2fa7e12 Ciara Loftus     2020-06-23  579  		ring = kmemdup(vsi->xdp_rings[ring_id], sizeof(*ring), GFP_KERNEL);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  580  		break;

Add default case?

44ea803e2fa7e12 Ciara Loftus     2020-06-23  581  	}
e6c97234d1b18d4 Joe Perches      2014-11-18 @582  	if (!ring)
                                                            ^^^^^
e6c97234d1b18d4 Joe Perches      2014-11-18  583  		return;
e6c97234d1b18d4 Joe Perches      2014-11-18  584  
02e9c290814cc14 Jesse Brandeburg 2013-09-11  585  	if (cnt == 2) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  586  		switch (type) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  587  		case RING_TYPE_RX:

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 38569 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: drivers/net/ethernet/intel/i40e/i40e_debugfs.c:582 i40e_dbg_dump_desc() error: uninitialized symbol 'ring'.
Date: Tue, 06 Oct 2020 15:45:18 +0300	[thread overview]
Message-ID: <20201006124518.GE4282@kadam> (raw)

[-- Attachment #1: Type: text/plain, Size: 4540 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   60e720931556fc1034d0981460164dcf02697679
commit: 44ea803e2fa7e12adb5d6260da4e4956e784effb i40e: introduce new dump desc XDP command
config: i386-randconfig-m021-20201001 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/net/ethernet/intel/i40e/i40e_debugfs.c:582 i40e_dbg_dump_desc() error: uninitialized symbol 'ring'.

vim +/ring +582 drivers/net/ethernet/intel/i40e/i40e_debugfs.c

02e9c290814cc14 Jesse Brandeburg 2013-09-11  541  static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
44ea803e2fa7e12 Ciara Loftus     2020-06-23  542  			       struct i40e_pf *pf, enum ring_type type)
02e9c290814cc14 Jesse Brandeburg 2013-09-11  543  {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  544  	bool is_rx_ring = type == RING_TYPE_RX;
68bf94aae1873cb Shannon Nelson   2014-01-15  545  	struct i40e_tx_desc *txd;
68bf94aae1873cb Shannon Nelson   2014-01-15  546  	union i40e_rx_desc *rxd;
e6c97234d1b18d4 Joe Perches      2014-11-18  547  	struct i40e_ring *ring;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  548  	struct i40e_vsi *vsi;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  549  	int i;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  550  
02e9c290814cc14 Jesse Brandeburg 2013-09-11  551  	vsi = i40e_dbg_find_vsi(pf, vsi_seid);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  552  	if (!vsi) {
7792fe4fd2f1fac Shannon Nelson   2013-11-26  553  		dev_info(&pf->pdev->dev, "vsi %d not found\n", vsi_seid);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  554  		return;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  555  	}
44ea803e2fa7e12 Ciara Loftus     2020-06-23  556  	if (type == RING_TYPE_XDP && !i40e_enabled_xdp_vsi(vsi)) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  557  		dev_info(&pf->pdev->dev, "XDP not enabled on VSI %d\n", vsi_seid);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  558  		return;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  559  	}
02e9c290814cc14 Jesse Brandeburg 2013-09-11  560  	if (ring_id >= vsi->num_queue_pairs || ring_id < 0) {
02e9c290814cc14 Jesse Brandeburg 2013-09-11  561  		dev_info(&pf->pdev->dev, "ring %d not found\n", ring_id);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  562  		return;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  563  	}
68bf94aae1873cb Shannon Nelson   2014-01-15  564  	if (!vsi->tx_rings || !vsi->tx_rings[0]->desc) {
29d0790ef3acd86 Shannon Nelson   2013-11-26  565  		dev_info(&pf->pdev->dev,
29d0790ef3acd86 Shannon Nelson   2013-11-26  566  			 "descriptor rings have not been allocated for vsi %d\n",
29d0790ef3acd86 Shannon Nelson   2013-11-26  567  			 vsi_seid);
29d0790ef3acd86 Shannon Nelson   2013-11-26  568  		return;
29d0790ef3acd86 Shannon Nelson   2013-11-26  569  	}
e6c97234d1b18d4 Joe Perches      2014-11-18  570  
44ea803e2fa7e12 Ciara Loftus     2020-06-23  571  	switch (type) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  572  	case RING_TYPE_RX:
44ea803e2fa7e12 Ciara Loftus     2020-06-23  573  		ring = kmemdup(vsi->rx_rings[ring_id], sizeof(*ring), GFP_KERNEL);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  574  		break;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  575  	case RING_TYPE_TX:
44ea803e2fa7e12 Ciara Loftus     2020-06-23  576  		ring = kmemdup(vsi->tx_rings[ring_id], sizeof(*ring), GFP_KERNEL);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  577  		break;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  578  	case RING_TYPE_XDP:
44ea803e2fa7e12 Ciara Loftus     2020-06-23  579  		ring = kmemdup(vsi->xdp_rings[ring_id], sizeof(*ring), GFP_KERNEL);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  580  		break;

Add default case?

44ea803e2fa7e12 Ciara Loftus     2020-06-23  581  	}
e6c97234d1b18d4 Joe Perches      2014-11-18 @582  	if (!ring)
                                                            ^^^^^
e6c97234d1b18d4 Joe Perches      2014-11-18  583  		return;
e6c97234d1b18d4 Joe Perches      2014-11-18  584  
02e9c290814cc14 Jesse Brandeburg 2013-09-11  585  	if (cnt == 2) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  586  		switch (type) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  587  		case RING_TYPE_RX:

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 38569 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Ciara Loftus <ciara.loftus@intel.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	Tony Nguyen <anthony.l.nguyen@intel.com>
Subject: drivers/net/ethernet/intel/i40e/i40e_debugfs.c:582 i40e_dbg_dump_desc() error: uninitialized symbol 'ring'.
Date: Tue, 6 Oct 2020 15:45:18 +0300	[thread overview]
Message-ID: <20201006124518.GE4282@kadam> (raw)

[-- Attachment #1: Type: text/plain, Size: 4468 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   60e720931556fc1034d0981460164dcf02697679
commit: 44ea803e2fa7e12adb5d6260da4e4956e784effb i40e: introduce new dump desc XDP command
config: i386-randconfig-m021-20201001 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/net/ethernet/intel/i40e/i40e_debugfs.c:582 i40e_dbg_dump_desc() error: uninitialized symbol 'ring'.

vim +/ring +582 drivers/net/ethernet/intel/i40e/i40e_debugfs.c

02e9c290814cc14 Jesse Brandeburg 2013-09-11  541  static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
44ea803e2fa7e12 Ciara Loftus     2020-06-23  542  			       struct i40e_pf *pf, enum ring_type type)
02e9c290814cc14 Jesse Brandeburg 2013-09-11  543  {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  544  	bool is_rx_ring = type == RING_TYPE_RX;
68bf94aae1873cb Shannon Nelson   2014-01-15  545  	struct i40e_tx_desc *txd;
68bf94aae1873cb Shannon Nelson   2014-01-15  546  	union i40e_rx_desc *rxd;
e6c97234d1b18d4 Joe Perches      2014-11-18  547  	struct i40e_ring *ring;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  548  	struct i40e_vsi *vsi;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  549  	int i;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  550  
02e9c290814cc14 Jesse Brandeburg 2013-09-11  551  	vsi = i40e_dbg_find_vsi(pf, vsi_seid);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  552  	if (!vsi) {
7792fe4fd2f1fac Shannon Nelson   2013-11-26  553  		dev_info(&pf->pdev->dev, "vsi %d not found\n", vsi_seid);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  554  		return;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  555  	}
44ea803e2fa7e12 Ciara Loftus     2020-06-23  556  	if (type == RING_TYPE_XDP && !i40e_enabled_xdp_vsi(vsi)) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  557  		dev_info(&pf->pdev->dev, "XDP not enabled on VSI %d\n", vsi_seid);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  558  		return;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  559  	}
02e9c290814cc14 Jesse Brandeburg 2013-09-11  560  	if (ring_id >= vsi->num_queue_pairs || ring_id < 0) {
02e9c290814cc14 Jesse Brandeburg 2013-09-11  561  		dev_info(&pf->pdev->dev, "ring %d not found\n", ring_id);
02e9c290814cc14 Jesse Brandeburg 2013-09-11  562  		return;
02e9c290814cc14 Jesse Brandeburg 2013-09-11  563  	}
68bf94aae1873cb Shannon Nelson   2014-01-15  564  	if (!vsi->tx_rings || !vsi->tx_rings[0]->desc) {
29d0790ef3acd86 Shannon Nelson   2013-11-26  565  		dev_info(&pf->pdev->dev,
29d0790ef3acd86 Shannon Nelson   2013-11-26  566  			 "descriptor rings have not been allocated for vsi %d\n",
29d0790ef3acd86 Shannon Nelson   2013-11-26  567  			 vsi_seid);
29d0790ef3acd86 Shannon Nelson   2013-11-26  568  		return;
29d0790ef3acd86 Shannon Nelson   2013-11-26  569  	}
e6c97234d1b18d4 Joe Perches      2014-11-18  570  
44ea803e2fa7e12 Ciara Loftus     2020-06-23  571  	switch (type) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  572  	case RING_TYPE_RX:
44ea803e2fa7e12 Ciara Loftus     2020-06-23  573  		ring = kmemdup(vsi->rx_rings[ring_id], sizeof(*ring), GFP_KERNEL);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  574  		break;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  575  	case RING_TYPE_TX:
44ea803e2fa7e12 Ciara Loftus     2020-06-23  576  		ring = kmemdup(vsi->tx_rings[ring_id], sizeof(*ring), GFP_KERNEL);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  577  		break;
44ea803e2fa7e12 Ciara Loftus     2020-06-23  578  	case RING_TYPE_XDP:
44ea803e2fa7e12 Ciara Loftus     2020-06-23  579  		ring = kmemdup(vsi->xdp_rings[ring_id], sizeof(*ring), GFP_KERNEL);
44ea803e2fa7e12 Ciara Loftus     2020-06-23  580  		break;

Add default case?

44ea803e2fa7e12 Ciara Loftus     2020-06-23  581  	}
e6c97234d1b18d4 Joe Perches      2014-11-18 @582  	if (!ring)
                                                            ^^^^^
e6c97234d1b18d4 Joe Perches      2014-11-18  583  		return;
e6c97234d1b18d4 Joe Perches      2014-11-18  584  
02e9c290814cc14 Jesse Brandeburg 2013-09-11  585  	if (cnt == 2) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  586  		switch (type) {
44ea803e2fa7e12 Ciara Loftus     2020-06-23  587  		case RING_TYPE_RX:

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 38569 bytes --]

             reply	other threads:[~2020-10-06 12:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06 12:45 Dan Carpenter [this message]
2020-10-06 12:45 ` drivers/net/ethernet/intel/i40e/i40e_debugfs.c:582 i40e_dbg_dump_desc() error: uninitialized symbol 'ring' Dan Carpenter
2020-10-06 12:45 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2020-12-27 15:16 kernel test robot
2020-10-01 14:12 kernel test robot
2020-08-19 14:01 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201006124518.GE4282@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.