All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: drivers/net/dsa/sja1105/sja1105_main.c:505 sja1105_init_avb_params() warn: is 'table->entries' large enough for 'struct sja1105_avb_params_entry'? 1
Date: Wed, 8 Nov 2023 07:02:58 +0800	[thread overview]
Message-ID: <202311080652.OG3NH2mG-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Vladimir Oltean <vladimir.oltean@nxp.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   13d88ac54ddd1011b6e94443958e798aa06eb835
commit: 79d5511cc0eedbb2e49b543507d795f927db311b net: dsa: sja1105: unconditionally set DESTMETA and SRCMETA in AVB table
date:   3 years, 8 months ago
:::::: branch date: 2 hours ago
:::::: commit date: 3 years, 8 months ago
config: i386-randconfig-141-20231030 (https://download.01.org/0day-ci/archive/20231108/202311080652.OG3NH2mG-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231108/202311080652.OG3NH2mG-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202311080652.OG3NH2mG-lkp@intel.com/

New smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:505 sja1105_init_avb_params() warn: is 'table->entries' large enough for 'struct sja1105_avb_params_entry'? 1

Old smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:186 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:189 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:195 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:200 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:1640 sja1105_static_config_reload() warn: bitwise AND condition is false here

vim +505 drivers/net/dsa/sja1105/sja1105_main.c

8aa9ebccae8762 Vladimir Oltean 2019-05-02  481  
79d5511cc0eedb Vladimir Oltean 2020-03-24  482  static int sja1105_init_avb_params(struct sja1105_private *priv)
79d5511cc0eedb Vladimir Oltean 2020-03-24  483  {
79d5511cc0eedb Vladimir Oltean 2020-03-24  484  	struct sja1105_avb_params_entry *avb;
79d5511cc0eedb Vladimir Oltean 2020-03-24  485  	struct sja1105_table *table;
79d5511cc0eedb Vladimir Oltean 2020-03-24  486  
79d5511cc0eedb Vladimir Oltean 2020-03-24  487  	table = &priv->static_config.tables[BLK_IDX_AVB_PARAMS];
79d5511cc0eedb Vladimir Oltean 2020-03-24  488  
79d5511cc0eedb Vladimir Oltean 2020-03-24  489  	/* Discard previous AVB Parameters Table */
79d5511cc0eedb Vladimir Oltean 2020-03-24  490  	if (table->entry_count) {
79d5511cc0eedb Vladimir Oltean 2020-03-24  491  		kfree(table->entries);
79d5511cc0eedb Vladimir Oltean 2020-03-24  492  		table->entry_count = 0;
79d5511cc0eedb Vladimir Oltean 2020-03-24  493  	}
79d5511cc0eedb Vladimir Oltean 2020-03-24  494  
79d5511cc0eedb Vladimir Oltean 2020-03-24  495  	table->entries = kcalloc(SJA1105_MAX_AVB_PARAMS_COUNT,
79d5511cc0eedb Vladimir Oltean 2020-03-24  496  				 table->ops->unpacked_entry_size, GFP_KERNEL);
79d5511cc0eedb Vladimir Oltean 2020-03-24  497  	if (!table->entries)
79d5511cc0eedb Vladimir Oltean 2020-03-24  498  		return -ENOMEM;
79d5511cc0eedb Vladimir Oltean 2020-03-24  499  
79d5511cc0eedb Vladimir Oltean 2020-03-24  500  	table->entry_count = SJA1105_MAX_AVB_PARAMS_COUNT;
79d5511cc0eedb Vladimir Oltean 2020-03-24  501  
79d5511cc0eedb Vladimir Oltean 2020-03-24  502  	avb = table->entries;
79d5511cc0eedb Vladimir Oltean 2020-03-24  503  
79d5511cc0eedb Vladimir Oltean 2020-03-24  504  	/* Configure the MAC addresses for meta frames */
79d5511cc0eedb Vladimir Oltean 2020-03-24 @505  	avb->destmeta = SJA1105_META_DMAC;
79d5511cc0eedb Vladimir Oltean 2020-03-24  506  	avb->srcmeta  = SJA1105_META_SMAC;
79d5511cc0eedb Vladimir Oltean 2020-03-24  507  
79d5511cc0eedb Vladimir Oltean 2020-03-24  508  	return 0;
79d5511cc0eedb Vladimir Oltean 2020-03-24  509  }
79d5511cc0eedb Vladimir Oltean 2020-03-24  510  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2023-11-07 23:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-07 23:02 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-12-03  6:31 drivers/net/dsa/sja1105/sja1105_main.c:505 sja1105_init_avb_params() warn: is 'table->entries' large enough for 'struct sja1105_avb_params_entry'? 1 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=202311080652.OG3NH2mG-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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.