lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202208110633.vYSBRTKf-lkp@intel.com>
Date:   Thu, 11 Aug 2022 14:11:20 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     kbuild@...ts.01.org, Bard Liao <yung-chuan.liao@...ux.intel.com>
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org, Mark Brown <broonie@...nel.org>,
        Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
        Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>
Subject: sound/soc/sof/ipc4-topology.c:1143 sof_ipc4_prepare_copier_module()
 error: Calling ida_alloc_max() with a 'max' argument which is a power of 2.
 -1 missing?

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f41445645ab5d172e6090d00c332c335d8dba337
commit: a150345aa758492e05d2934f318ce7c2566b1cfe ASoC: SOF: ipc4-topology: add SoundWire/ALH aggregation support
config: i386-randconfig-m021-20220808 (https://download.01.org/0day-ci/archive/20220811/202208110633.vYSBRTKf-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>

smatch warnings:
sound/soc/sof/ipc4-topology.c:1143 sof_ipc4_prepare_copier_module() error: Calling ida_alloc_max() with a 'max' argument which is a power of 2. -1 missing?

vim +/max +1143 sound/soc/sof/ipc4-topology.c

a150345aa75849 Bard Liao         2022-06-14  1140  			if (blob->alh_cfg.count > 1) {
a150345aa75849 Bard Liao         2022-06-14  1141  				int group_id;
a150345aa75849 Bard Liao         2022-06-14  1142  
a150345aa75849 Bard Liao         2022-06-14 @1143  				group_id = ida_alloc_max(&alh_group_ida, ALH_MULTI_GTW_COUNT,

I didn't write this Smatch check.  I guess the theory is that normally
we would want group_id to be 0-7 instead of 0-8.  But when I look at
the surrounding code I'm sort of curious why it's not 0-255?

a150345aa75849 Bard Liao         2022-06-14  1144  							 GFP_KERNEL);
a150345aa75849 Bard Liao         2022-06-14  1145  
a150345aa75849 Bard Liao         2022-06-14  1146  				if (group_id < 0)
a150345aa75849 Bard Liao         2022-06-14  1147  					return group_id;
a150345aa75849 Bard Liao         2022-06-14  1148  
a150345aa75849 Bard Liao         2022-06-14  1149  				/* add multi-gateway base */
a150345aa75849 Bard Liao         2022-06-14  1150  				group_id += ALH_MULTI_GTW_BASE;
a150345aa75849 Bard Liao         2022-06-14  1151  				copier_data->gtw_cfg.node_id &= ~SOF_IPC4_NODE_INDEX_MASK;
a150345aa75849 Bard Liao         2022-06-14  1152  				copier_data->gtw_cfg.node_id |= SOF_IPC4_NODE_INDEX(group_id);
a150345aa75849 Bard Liao         2022-06-14  1153  			}
a45a4d4390b7a5 Bard Liao         2022-06-08  1154  		}
a45a4d4390b7a5 Bard Liao         2022-06-08  1155  	}
a45a4d4390b7a5 Bard Liao         2022-06-08  1156  	}

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ