[djwong-xfs:dax-zeroinit-clear-poison-5.15 68/68] fs/ext4/extents.c:4695:8: warning: variable 'max_blocks' is used uninitialized whenever 'if' condition is true
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git dax-zeroinit-clear-poison-5.15
head: 6380ce8db23c88d70b9954ff66477719ea84bf3f
commit: 6380ce8db23c88d70b9954ff66477719ea84bf3f [68/68] ext4: use DAX block device zeroout for FSDAX file ZERO_RANGE operations
config: x86_64-randconfig-a011-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 44d0a99a12ec7ead4d2f5ef649ba05b40f6d463d)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/comm...
git remote add djwong-xfs https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
git fetch --no-tags djwong-xfs dax-zeroinit-clear-poison-5.15
git checkout 6380ce8db23c88d70b9954ff66477719ea84bf3f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> fs/ext4/extents.c:4695:8: warning: variable 'max_blocks' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (ret || did_zeroout)
^~~~~~~~~~~~~~~~~~
fs/ext4/extents.c:4741:43: note: uninitialized use occurs here
trace_ext4_fallocate_exit(inode, offset, max_blocks, ret);
^~~~~~~~~~
fs/ext4/extents.c:4695:4: note: remove the 'if' if its condition is always false
if (ret || did_zeroout)
^~~~~~~~~~~~~~~~~~~~~~~
>> fs/ext4/extents.c:4695:8: warning: variable 'max_blocks' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
if (ret || did_zeroout)
^~~
fs/ext4/extents.c:4741:43: note: uninitialized use occurs here
trace_ext4_fallocate_exit(inode, offset, max_blocks, ret);
^~~~~~~~~~
fs/ext4/extents.c:4695:8: note: remove the '||' if its condition is always false
if (ret || did_zeroout)
^~~~~~
fs/ext4/extents.c:4638:25: note: initialize the variable 'max_blocks' to silence this warning
unsigned int max_blocks;
^
= 0
2 warnings generated.
vim +4695 fs/ext4/extents.c
4626
4627 /*
4628 * preallocate space for a file. This implements ext4's fallocate file
4629 * operation, which gets called from sys_fallocate system call.
4630 * For block-mapped files, posix_fallocate should fall back to the method
4631 * of writing zeroes to the required new blocks (the same behavior which is
4632 * expected for file systems which do not support fallocate() system call).
4633 */
4634 long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
4635 {
4636 struct inode *inode = file_inode(file);
4637 loff_t new_size = 0;
4638 unsigned int max_blocks;
4639 int ret = 0;
4640 int flags;
4641 ext4_lblk_t lblk;
4642 unsigned int blkbits = inode->i_blkbits;
4643
4644 /*
4645 * Encrypted inodes can't handle collapse range or insert
4646 * range since we would need to re-encrypt blocks with a
4647 * different IV or XTS tweak (which are based on the logical
4648 * block number).
4649 */
4650 if (IS_ENCRYPTED(inode) &&
4651 (mode & (FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_INSERT_RANGE)))
4652 return -EOPNOTSUPP;
4653
4654 /* Return error if mode is not supported */
4655 if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |
4656 FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_ZERO_RANGE |
4657 FALLOC_FL_INSERT_RANGE))
4658 return -EOPNOTSUPP;
4659
4660 ext4_fc_start_update(inode);
4661
4662 if (mode & FALLOC_FL_PUNCH_HOLE) {
4663 ret = ext4_punch_hole(inode, offset, len);
4664 goto exit;
4665 }
4666
4667 ret = ext4_convert_inline_data(inode);
4668 if (ret)
4669 goto exit;
4670
4671 if (mode & FALLOC_FL_COLLAPSE_RANGE) {
4672 ret = ext4_collapse_range(inode, offset, len);
4673 goto exit;
4674 }
4675
4676 if (mode & FALLOC_FL_INSERT_RANGE) {
4677 ret = ext4_insert_range(inode, offset, len);
4678 goto exit;
4679 }
4680
4681 if (mode & FALLOC_FL_ZERO_RANGE) {
4682 /*
4683 * If the file is in DAX mode, try to use a DAX-specific
4684 * function to zero the region.
4685 */
4686 if (IS_DAX(inode)) {
4687 bool did_zeroout = false;
4688
4689 inode_lock(inode);
4690
4691 ret = dax_zeroinit_range(inode, offset, len,
4692 &did_zeroout, &ext4_iomap_report_ops);
4693 if (ret == -EINVAL)
4694 ret = 0;
> 4695 if (ret || did_zeroout)
4696 goto out;
4697
4698 inode_unlock(inode);
4699 }
4700 ret = ext4_zero_range(file, offset, len, mode);
4701 goto exit;
4702 }
4703 trace_ext4_fallocate_enter(inode, offset, len, mode);
4704 lblk = offset >> blkbits;
4705
4706 max_blocks = EXT4_MAX_BLOCKS(len, offset, blkbits);
4707 flags = EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT;
4708
4709 inode_lock(inode);
4710
4711 /*
4712 * We only support preallocation for extent-based files only
4713 */
4714 if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
4715 ret = -EOPNOTSUPP;
4716 goto out;
4717 }
4718
4719 if (!(mode & FALLOC_FL_KEEP_SIZE) &&
4720 (offset + len > inode->i_size ||
4721 offset + len > EXT4_I(inode)->i_disksize)) {
4722 new_size = offset + len;
4723 ret = inode_newsize_ok(inode, new_size);
4724 if (ret)
4725 goto out;
4726 }
4727
4728 /* Wait all existing dio workers, newcomers will block on i_mutex */
4729 inode_dio_wait(inode);
4730
4731 ret = ext4_alloc_file_blocks(file, lblk, max_blocks, new_size, flags);
4732 if (ret)
4733 goto out;
4734
4735 if (file->f_flags & O_SYNC && EXT4_SB(inode->i_sb)->s_journal) {
4736 ret = ext4_fc_commit(EXT4_SB(inode->i_sb)->s_journal,
4737 EXT4_I(inode)->i_sync_tid);
4738 }
4739 out:
4740 inode_unlock(inode);
4741 trace_ext4_fallocate_exit(inode, offset, max_blocks, ret);
4742 exit:
4743 ext4_fc_stop_update(inode);
4744 return ret;
4745 }
4746
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH 1/2] soc: aspeed: Add LPC mailbox support
by Dan Carpenter
Hi Chia-Wei,
url: https://github.com/0day-ci/linux/commits/Chia-Wei-Wang/aspeed-Add-LPC-mai...
base: https://git.kernel.org/pub/scm/linux/kernel/git/joel/aspeed.git for-next
config: openrisc-randconfig-m031-20210816 (attached as .config)
compiler: or1k-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/soc/aspeed/aspeed-lpc-mbox.c:230 aspeed_mbox_ioctl() warn: maybe return -EFAULT instead of the bytes remaining?
vim +230 drivers/soc/aspeed/aspeed-lpc-mbox.c
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 214 static long aspeed_mbox_ioctl(struct file *file, unsigned int cmd,
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 215 unsigned long param)
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 216 {
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 217 struct aspeed_mbox *mbox = file_mbox(file);
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 218 const struct aspeed_mbox_model *model = mbox->model;
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 219 struct aspeed_mbox_ioctl_data data;
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 220 long ret;
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 221
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 222 switch (cmd) {
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 223 case ASPEED_MBOX_IOCTL_GET_SIZE:
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 224 data.data = model->dr_num;
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 225 ret = copy_to_user((void __user *)param, &data, sizeof(data));
This should be:
if (copy_to_user((void __user *)param, &data, sizeof(data)))
return -EFAULT;
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 226 break;
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 227 default:
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 228 ret = -ENOTTY;
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 229 }
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 @230 return ret;
72c5a69dc779f5 Chia-Wei Wang 2021-08-13 231 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH v3 2/6] input: add Qualcomm SPMI haptics driver
by kernel test robot
Hi Caleb,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on input/next v5.14-rc6 next-20210816]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Caleb-Connolly/input-Introduce-s...
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/4fe3986969c516117a071eb5f9df141c6...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Caleb-Connolly/input-Introduce-support-for-SPMI-haptics-found-on-Qcom-PMICs/20210817-062200
git checkout 4fe3986969c516117a071eb5f9df141c6fc95b69
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/input/misc/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/input/misc/qcom-spmi-haptics.c:196: warning: Function parameter or member 'haptics_input_dev' not described in 'spmi_haptics'
drivers/input/misc/qcom-spmi-haptics.c:634: warning: Excess function parameter 'enable' description in 'spmi_haptics_enable'
>> drivers/input/misc/qcom-spmi-haptics.c:679: warning: expecting prototype for spmi_haptics_enable(). Prototype was for spmi_haptics_disable() instead
vim +679 drivers/input/misc/qcom-spmi-haptics.c
671
672 /**
673 * spmi_haptics_enable - handler to start/stop vibration
674 * @haptics: pointer to haptics struct
675 * @enable: state to set
676 * Returns: 0 on success, < 0 on failure
677 */
678 static int spmi_haptics_disable(struct spmi_haptics *haptics)
> 679 {
680 int ret;
681
682 mutex_lock(&haptics->play_lock);
683
684 ret = spmi_haptics_write_play_control(haptics, HAP_STOP);
685 if (ret < 0) {
686 dev_err(haptics->dev, "Error disabling play, ret=%d\n", ret);
687 goto out;
688 }
689
690 ret = spmi_haptics_module_enable(haptics, false);
691 if (ret < 0) {
692 dev_err(haptics->dev, "Error disabling module, ret=%d\n", ret);
693 goto out;
694 }
695
696 out:
697 mutex_unlock(&haptics->play_lock);
698 return ret;
699 }
700
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH] fix slab-out-of-bounds Write in betop_probe
by kernel test robot
Hi "F.A.Sulaiman",
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on hid/for-next]
[also build test WARNING on v5.14-rc6 next-20210816]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/F-A-Sulaiman/fix-slab-out-of-bou...
base: https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-next
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/8fc4d7961e182bc2992bee548fa3c33b6...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review F-A-Sulaiman/fix-slab-out-of-bounds-Write-in-betop_probe/20210817-041818
git checkout 8fc4d7961e182bc2992bee548fa3c33b628ffadd
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/hid/hid-betopff.c: In function 'betop_probe':
>> drivers/hid/hid-betopff.c:118:20: warning: variable 'dev' set but not used [-Wunused-but-set-variable]
118 | struct input_dev *dev;
| ^~~
vim +/dev +118 drivers/hid/hid-betopff.c
114
115 static int betop_probe(struct hid_device *hdev, const struct hid_device_id *id)
116 {
117 struct hid_input *hidinput;
> 118 struct input_dev *dev;
119 int ret;
120
121 if (list_empty(&hdev->inputs)) {
122 hid_err(hdev, "no inputs found\n");
123 return -ENODEV;
124 }
125
126 hidinput = list_first_entry(&hdev->inputs, struct hid_input, list);
127 dev = hidinput->input;
128
129 if (id->driver_data)
130 hdev->quirks |= HID_QUIRK_MULTI_INPUT;
131
132 ret = hid_parse(hdev);
133 if (ret) {
134 hid_err(hdev, "parse failed\n");
135 goto err;
136 }
137
138 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF);
139 if (ret) {
140 hid_err(hdev, "hw start failed\n");
141 goto err;
142 }
143
144 betopff_init(hdev);
145
146 return 0;
147 err:
148 return ret;
149 }
150
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH] fix slab-out-of-bounds Write in betop_probe
by kernel test robot
Hi "F.A.Sulaiman",
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on hid/for-next]
[also build test WARNING on v5.14-rc6 next-20210816]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/F-A-Sulaiman/fix-slab-out-of-bou...
base: https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-next
config: x86_64-randconfig-r023-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 44d0a99a12ec7ead4d2f5ef649ba05b40f6d463d)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/8fc4d7961e182bc2992bee548fa3c33b6...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review F-A-Sulaiman/fix-slab-out-of-bounds-Write-in-betop_probe/20210817-041818
git checkout 8fc4d7961e182bc2992bee548fa3c33b628ffadd
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/hid/hid-betopff.c:118:20: warning: variable 'dev' set but not used [-Wunused-but-set-variable]
struct input_dev *dev;
^
1 warning generated.
vim +/dev +118 drivers/hid/hid-betopff.c
114
115 static int betop_probe(struct hid_device *hdev, const struct hid_device_id *id)
116 {
117 struct hid_input *hidinput;
> 118 struct input_dev *dev;
119 int ret;
120
121 if (list_empty(&hdev->inputs)) {
122 hid_err(hdev, "no inputs found\n");
123 return -ENODEV;
124 }
125
126 hidinput = list_first_entry(&hdev->inputs, struct hid_input, list);
127 dev = hidinput->input;
128
129 if (id->driver_data)
130 hdev->quirks |= HID_QUIRK_MULTI_INPUT;
131
132 ret = hid_parse(hdev);
133 if (ret) {
134 hid_err(hdev, "parse failed\n");
135 goto err;
136 }
137
138 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF);
139 if (ret) {
140 hid_err(hdev, "hw start failed\n");
141 goto err;
142 }
143
144 betopff_init(hdev);
145
146 return 0;
147 err:
148 return ret;
149 }
150
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
sound/soc/fsl/fsl_xcvr.c:1048:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a2824f19e6065a0d3735acd9fe7155b104e7edf5
commit: 28564486866fa889b78264360022c94836fa8072 ASoC: fsl_xcvr: Add XCVR ASoC CPU DAI driver
date: 10 months ago
config: arm-randconfig-c002-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 44d0a99a12ec7ead4d2f5ef649ba05b40f6d463d)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 28564486866fa889b78264360022c94836fa8072
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
drivers/media/i2c/st-mipid02.c:747:21: warning: Value stored to 'client' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct i2c_client *client = bridge->i2c_client;
^~~~~~ ~~~~~~~~~~~~~~~~~~
drivers/media/i2c/st-mipid02.c:747:21: note: Value stored to 'client' during its initialization is never read
struct i2c_client *client = bridge->i2c_client;
^~~~~~ ~~~~~~~~~~~~~~~~~~
drivers/media/i2c/st-mipid02.c:919:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = -EINVAL;
^ ~~~~~~~
drivers/media/i2c/st-mipid02.c:919:3: note: Value stored to 'ret' is never read
ret = -EINVAL;
^ ~~~~~~~
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
drivers/media/tuners/tuner-xc2028.c:1037:3: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores]
rc = send_seq(priv, {0x00, 0x00});
^
drivers/media/tuners/tuner-xc2028.c:1037:3: note: Value stored to 'rc' is never read
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
sound/soc/soc-pcm.c:1955:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = dpcm_be_dai_hw_free(fe, stream);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/soc-pcm.c:1955:2: note: Value stored to 'err' is never read
err = dpcm_be_dai_hw_free(fe, stream);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
sound/soc/soc-ops.c:370:26: warning: The result of the left shift is undefined because the right operand is negative [clang-analyzer-core.UndefinedBinaryOperatorResult]
unsigned int mask = (1U << (fls(min + max) - 1)) - 1;
^ ~~~~~~~~~~~~~~~~~~~~
sound/soc/soc-ops.c:370:26: note: The result of the left shift is undefined because the right operand is negative
unsigned int mask = (1U << (fls(min + max) - 1)) - 1;
^ ~~~~~~~~~~~~~~~~~~~~
sound/soc/soc-ops.c:408:26: warning: The result of the left shift is undefined because the right operand is negative [clang-analyzer-core.UndefinedBinaryOperatorResult]
unsigned int mask = (1U << (fls(min + max) - 1)) - 1;
^ ~~~~~~~~~~~~~~~~~~~~
sound/soc/soc-ops.c:408:26: note: The result of the left shift is undefined because the right operand is negative
unsigned int mask = (1U << (fls(min + max) - 1)) - 1;
^ ~~~~~~~~~~~~~~~~~~~~
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
drivers/mmc/core/core.c:2010:19: warning: Value stored to 'host' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct mmc_host *host = card->host;
^~~~ ~~~~~~~~~~
drivers/mmc/core/core.c:2010:19: note: Value stored to 'host' during its initialization is never read
struct mmc_host *host = card->host;
^~~~ ~~~~~~~~~~
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
>> sound/soc/fsl/fsl_xcvr.c:1048:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = &xcvr->pdev->dev;
^~~ ~~~~~~~~~~~~~~~~
sound/soc/fsl/fsl_xcvr.c:1048:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = &xcvr->pdev->dev;
^~~ ~~~~~~~~~~~~~~~~
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
vim +/dev +1048 sound/soc/fsl/fsl_xcvr.c
1044
1045 static irqreturn_t irq0_isr(int irq, void *devid)
1046 {
1047 struct fsl_xcvr *xcvr = (struct fsl_xcvr *)devid;
> 1048 struct device *dev = &xcvr->pdev->dev;
1049 struct regmap *regmap = xcvr->regmap;
1050 void __iomem *reg_ctrl, *reg_buff;
1051 u32 isr, isr_clr = 0, val, i;
1052
1053 regmap_read(regmap, FSL_XCVR_EXT_ISR, &isr);
1054
1055 if (isr & FSL_XCVR_IRQ_NEW_CS) {
1056 dev_dbg(dev, "Received new CS block\n");
1057 isr_clr |= FSL_XCVR_IRQ_NEW_CS;
1058 /* Data RAM is 4KiB, last two pages: 8 and 9. Select page 8. */
1059 regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL,
1060 FSL_XCVR_EXT_CTRL_PAGE_MASK,
1061 FSL_XCVR_EXT_CTRL_PAGE(8));
1062
1063 /* Find updated CS buffer */
1064 reg_ctrl = xcvr->ram_addr + FSL_XCVR_RX_CS_CTRL_0;
1065 reg_buff = xcvr->ram_addr + FSL_XCVR_RX_CS_BUFF_0;
1066 memcpy_fromio(&val, reg_ctrl, sizeof(val));
1067 if (!val) {
1068 reg_ctrl = xcvr->ram_addr + FSL_XCVR_RX_CS_CTRL_1;
1069 reg_buff = xcvr->ram_addr + FSL_XCVR_RX_CS_BUFF_1;
1070 memcpy_fromio(&val, reg_ctrl, sizeof(val));
1071 }
1072
1073 if (val) {
1074 /* copy CS buffer */
1075 memcpy_fromio(&xcvr->rx_iec958.status, reg_buff,
1076 sizeof(xcvr->rx_iec958.status));
1077 for (i = 0; i < 6; i++) {
1078 val = *(u32 *)(xcvr->rx_iec958.status + i*4);
1079 *(u32 *)(xcvr->rx_iec958.status + i*4) =
1080 bitrev32(val);
1081 }
1082 /* clear CS control register */
1083 memset_io(reg_ctrl, 0, sizeof(val));
1084 }
1085 }
1086 if (isr & FSL_XCVR_IRQ_NEW_UD) {
1087 dev_dbg(dev, "Received new UD block\n");
1088 isr_clr |= FSL_XCVR_IRQ_NEW_UD;
1089 }
1090 if (isr & FSL_XCVR_IRQ_MUTE) {
1091 dev_dbg(dev, "HW mute bit detected\n");
1092 isr_clr |= FSL_XCVR_IRQ_MUTE;
1093 }
1094 if (isr & FSL_XCVR_IRQ_FIFO_UOFL_ERR) {
1095 dev_dbg(dev, "RX/TX FIFO full/empty\n");
1096 isr_clr |= FSL_XCVR_IRQ_FIFO_UOFL_ERR;
1097 }
1098 if (isr & FSL_XCVR_IRQ_ARC_MODE) {
1099 dev_dbg(dev, "CMDC SM falls out of eARC mode\n");
1100 isr_clr |= FSL_XCVR_IRQ_ARC_MODE;
1101 }
1102 if (isr & FSL_XCVR_IRQ_DMA_RD_REQ) {
1103 dev_dbg(dev, "DMA read request\n");
1104 isr_clr |= FSL_XCVR_IRQ_DMA_RD_REQ;
1105 }
1106 if (isr & FSL_XCVR_IRQ_DMA_WR_REQ) {
1107 dev_dbg(dev, "DMA write request\n");
1108 isr_clr |= FSL_XCVR_IRQ_DMA_WR_REQ;
1109 }
1110
1111 if (isr_clr) {
1112 regmap_write(regmap, FSL_XCVR_EXT_ISR_CLR, isr_clr);
1113 return IRQ_HANDLED;
1114 }
1115
1116 return IRQ_NONE;
1117 }
1118
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[linux-rt-devel:linux-5.14.y-rt-rebase 184/245] mm/vmalloc.c:1887:2: warning: Value stored to 'cpu' is never read [clang-analyzer-deadcode.DeadStores]
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-5.14.y-rt-rebase
head: 0eead4e5a60cb716ec911a552787a69332cf6943
commit: 9584df5e521f3b4e0a2063d7878762f7aa54fca5 [184/245] mm/vmalloc: Another preempt disable region which sucks
config: riscv-randconfig-c006-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 44d0a99a12ec7ead4d2f5ef649ba05b40f6d463d)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/com...
git remote add linux-rt-devel https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
git fetch --no-tags linux-rt-devel linux-5.14.y-rt-rebase
git checkout 9584df5e521f3b4e0a2063d7878762f7aa54fca5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^~~~~
include/asm-generic/bitops/fls.h:17:6: note: Assuming 'x' is not equal to 0, which participates in a condition later
if (!x)
^~
include/asm-generic/bitops/fls.h:17:2: note: Taking false branch
if (!x)
^
include/asm-generic/bitops/fls.h:19:6: note: Assuming the condition is false
if (!(x & 0xffff0000u)) {
^~~~~~~~~~~~~~~~~~
include/asm-generic/bitops/fls.h:19:2: note: Taking false branch
if (!(x & 0xffff0000u)) {
^
include/asm-generic/bitops/fls.h:23:6: note: Assuming the condition is false
if (!(x & 0xff000000u)) {
^~~~~~~~~~~~~~~~~~
include/asm-generic/bitops/fls.h:23:2: note: Taking false branch
if (!(x & 0xff000000u)) {
^
include/asm-generic/bitops/fls.h:27:6: note: Assuming the condition is false
if (!(x & 0xf0000000u)) {
^~~~~~~~~~~~~~~~~~
include/asm-generic/bitops/fls.h:27:2: note: Taking false branch
if (!(x & 0xf0000000u)) {
^
include/asm-generic/bitops/fls.h:31:6: note: Assuming the condition is false
if (!(x & 0xc0000000u)) {
^~~~~~~~~~~~~~~~~~
include/asm-generic/bitops/fls.h:31:2: note: Taking false branch
if (!(x & 0xc0000000u)) {
^
include/asm-generic/bitops/fls.h:35:6: note: Assuming the condition is false
if (!(x & 0x80000000u)) {
^~~~~~~~~~~~~~~~~~
include/asm-generic/bitops/fls.h:35:2: note: Taking false branch
if (!(x & 0x80000000u)) {
^
include/asm-generic/bitops/fls.h:39:2: note: Returning the value 32 (loaded from 'r')
return r;
^~~~~~~~
include/linux/bitops.h:188:10: note: Returning from 'fls'
return fls(l);
^~~~~~
include/linux/bitops.h:188:3: note: Returning the value 32
return fls(l);
^~~~~~~~~~~~~
include/linux/log2.h:57:16: note: Returning from 'fls_long'
return 1UL << fls_long(n - 1);
^~~~~~~~~~~~~~~
include/linux/log2.h:57:13: note: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'unsigned long'
return 1UL << fls_long(n - 1);
^ ~~~~~~~~~~~~~~~
Suppressed 14 warnings (14 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
8 warnings generated.
Suppressed 8 warnings (8 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
8 warnings generated.
Suppressed 8 warnings (8 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
17 warnings generated.
mm/vmalloc.c:285:2: warning: Value stored to 'start' is never read [clang-analyzer-deadcode.DeadStores]
start = addr;
^ ~~~~
mm/vmalloc.c:285:2: note: Value stored to 'start' is never read
start = addr;
^ ~~~~
mm/vmalloc.c:568:18: warning: Value stored to 'nr' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
unsigned int i, nr = (end - addr) >> PAGE_SHIFT;
^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/vmalloc.c:568:18: note: Value stored to 'nr' during its initialization is never read
unsigned int i, nr = (end - addr) >> PAGE_SHIFT;
^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> mm/vmalloc.c:1887:2: warning: Value stored to 'cpu' is never read [clang-analyzer-deadcode.DeadStores]
cpu = get_cpu_light();
^
mm/vmalloc.c:1887:2: note: Value stored to 'cpu' is never read
mm/vmalloc.c:1972:2: warning: Value stored to 'cpu' is never read [clang-analyzer-deadcode.DeadStores]
cpu = get_cpu_light();
^
mm/vmalloc.c:1972:2: note: Value stored to 'cpu' is never read
mm/vmalloc.c:1978:23: warning: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'unsigned long' [clang-analyzer-core.UndefinedBinaryOperatorResult]
if (vb->free < (1UL << order)) {
^ ~~~~~
mm/vmalloc.c:1959:2: note: Assuming the condition is true
BUG_ON(offset_in_page(size));
^
include/asm-generic/bug.h:65:36: note: expanded from macro 'BUG_ON'
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
^~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:78:40: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^~~~
mm/vmalloc.c:1959:2: note: Taking false branch
BUG_ON(offset_in_page(size));
^
include/asm-generic/bug.h:65:32: note: expanded from macro 'BUG_ON'
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
^
mm/vmalloc.c:1959:2: note: Loop condition is false. Exiting loop
BUG_ON(offset_in_page(size));
^
include/asm-generic/bug.h:65:27: note: expanded from macro 'BUG_ON'
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
^
mm/vmalloc.c:1960:9: note: Assuming the condition is false
BUG_ON(size > PAGE_SIZE*VMAP_MAX_ALLOC);
^
include/asm-generic/bug.h:65:45: note: expanded from macro 'BUG_ON'
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
~~~~~~~~~^~~~~~~~~~
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
mm/vmalloc.c:1960:2: note: Taking false branch
BUG_ON(size > PAGE_SIZE*VMAP_MAX_ALLOC);
^
include/asm-generic/bug.h:65:32: note: expanded from macro 'BUG_ON'
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
^
mm/vmalloc.c:1960:2: note: Loop condition is false. Exiting loop
BUG_ON(size > PAGE_SIZE*VMAP_MAX_ALLOC);
^
include/asm-generic/bug.h:65:27: note: expanded from macro 'BUG_ON'
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
^
mm/vmalloc.c:1961:14: note: Assuming 'size' is not equal to 0
if (WARN_ON(size == 0)) {
^
include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
int __ret_warn_on = !!(condition); \
^~~~~~~~~
mm/vmalloc.c:1961:6: note: Taking false branch
if (WARN_ON(size == 0)) {
^
include/asm-generic/bug.h:122:2: note: expanded from macro 'WARN_ON'
if (unlikely(__ret_warn_on)) \
^
mm/vmalloc.c:1961:2: note: Taking false branch
if (WARN_ON(size == 0)) {
^
mm/vmalloc.c:1969:10: note: Calling 'get_order'
order = get_order(size);
^~~~~~~~~~~~~~~
include/asm-generic/getorder.h:31:2: note: Taking false branch
if (__builtin_constant_p(size)) {
^
include/asm-generic/getorder.h:44:9: note: Calling 'fls'
return fls(size);
^~~~~~~~~
include/asm-generic/bitops/fls.h:15:2: note: 'r' initialized to 32
int r = 32;
^~~~~
include/asm-generic/bitops/fls.h:17:6: note: Assuming 'x' is not equal to 0, which participates in a condition later
if (!x)
^~
include/asm-generic/bitops/fls.h:17:2: note: Taking false branch
if (!x)
^
include/asm-generic/bitops/fls.h:19:6: note: Assuming the condition is false
if (!(x & 0xffff0000u)) {
^~~~~~~~~~~~~~~~~~
include/asm-generic/bitops/fls.h:19:2: note: Taking false branch
if (!(x & 0xffff0000u)) {
^
include/asm-generic/bitops/fls.h:23:6: note: Assuming the condition is false
if (!(x & 0xff000000u)) {
^~~~~~~~~~~~~~~~~~
include/asm-generic/bitops/fls.h:23:2: note: Taking false branch
if (!(x & 0xff000000u)) {
^
include/asm-generic/bitops/fls.h:27:6: note: Assuming the condition is false
if (!(x & 0xf0000000u)) {
^~~~~~~~~~~~~~~~~~
vim +/cpu +1887 mm/vmalloc.c
1835
1836 /**
1837 * new_vmap_block - allocates new vmap_block and occupies 2^order pages in this
1838 * block. Of course pages number can't exceed VMAP_BBMAP_BITS
1839 * @order: how many 2^order pages should be occupied in newly allocated block
1840 * @gfp_mask: flags for the page level allocator
1841 *
1842 * Return: virtual address in a newly allocated block or ERR_PTR(-errno)
1843 */
1844 static void *new_vmap_block(unsigned int order, gfp_t gfp_mask)
1845 {
1846 struct vmap_block_queue *vbq;
1847 struct vmap_block *vb;
1848 struct vmap_area *va;
1849 unsigned long vb_idx;
1850 int node, err, cpu;
1851 void *vaddr;
1852
1853 node = numa_node_id();
1854
1855 vb = kmalloc_node(sizeof(struct vmap_block),
1856 gfp_mask & GFP_RECLAIM_MASK, node);
1857 if (unlikely(!vb))
1858 return ERR_PTR(-ENOMEM);
1859
1860 va = alloc_vmap_area(VMAP_BLOCK_SIZE, VMAP_BLOCK_SIZE,
1861 VMALLOC_START, VMALLOC_END,
1862 node, gfp_mask);
1863 if (IS_ERR(va)) {
1864 kfree(vb);
1865 return ERR_CAST(va);
1866 }
1867
1868 vaddr = vmap_block_vaddr(va->va_start, 0);
1869 spin_lock_init(&vb->lock);
1870 vb->va = va;
1871 /* At least something should be left free */
1872 BUG_ON(VMAP_BBMAP_BITS <= (1UL << order));
1873 vb->free = VMAP_BBMAP_BITS - (1UL << order);
1874 vb->dirty = 0;
1875 vb->dirty_min = VMAP_BBMAP_BITS;
1876 vb->dirty_max = 0;
1877 INIT_LIST_HEAD(&vb->free_list);
1878
1879 vb_idx = addr_to_vb_idx(va->va_start);
1880 err = xa_insert(&vmap_blocks, vb_idx, vb, gfp_mask);
1881 if (err) {
1882 kfree(vb);
1883 free_vmap_area(va);
1884 return ERR_PTR(err);
1885 }
1886
> 1887 cpu = get_cpu_light();
1888 vbq = this_cpu_ptr(&vmap_block_queue);
1889 spin_lock(&vbq->lock);
1890 list_add_tail_rcu(&vb->free_list, &vbq->free);
1891 spin_unlock(&vbq->lock);
1892 put_cpu_light();
1893
1894 return vaddr;
1895 }
1896
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH] Bluetooth: add timeout sanity check to hci_inquiry
by kernel test robot
Hi Pavel,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on bluetooth/master]
[also build test ERROR on bluetooth-next/master net-next/master net/master sparc-next/master v5.14-rc6 next-20210816]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Pavel-Skripkin/Bluetooth-add-tim...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git master
config: hexagon-randconfig-r022-20210816 (attached as .config)
compiler: clang version 12.0.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/cb175bf2ea0de6152c66ce30cd1d3d665...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Pavel-Skripkin/Bluetooth-add-timeout-sanity-check-to-hci_inquiry/20210817-040113
git checkout cb175bf2ea0de6152c66ce30cd1d3d665fda338b
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=hexagon SHELL=/bin/bash net/bluetooth/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> net/bluetooth/hci_core.c:1346:18: error: use of undeclared identifier 'HCI_MAX_TIMEOUT'
if (ir.length > HCI_MAX_TIMEOUT) {
^
1 error generated.
vim +/HCI_MAX_TIMEOUT +1346 net/bluetooth/hci_core.c
1309
1310 int hci_inquiry(void __user *arg)
1311 {
1312 __u8 __user *ptr = arg;
1313 struct hci_inquiry_req ir;
1314 struct hci_dev *hdev;
1315 int err = 0, do_inquiry = 0, max_rsp;
1316 long timeo;
1317 __u8 *buf;
1318
1319 if (copy_from_user(&ir, ptr, sizeof(ir)))
1320 return -EFAULT;
1321
1322 hdev = hci_dev_get(ir.dev_id);
1323 if (!hdev)
1324 return -ENODEV;
1325
1326 if (hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) {
1327 err = -EBUSY;
1328 goto done;
1329 }
1330
1331 if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) {
1332 err = -EOPNOTSUPP;
1333 goto done;
1334 }
1335
1336 if (hdev->dev_type != HCI_PRIMARY) {
1337 err = -EOPNOTSUPP;
1338 goto done;
1339 }
1340
1341 if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) {
1342 err = -EOPNOTSUPP;
1343 goto done;
1344 }
1345
> 1346 if (ir.length > HCI_MAX_TIMEOUT) {
1347 err = -EINVAL;
1348 goto done;
1349 }
1350
1351 hci_dev_lock(hdev);
1352 if (inquiry_cache_age(hdev) > INQUIRY_CACHE_AGE_MAX ||
1353 inquiry_cache_empty(hdev) || ir.flags & IREQ_CACHE_FLUSH) {
1354 hci_inquiry_cache_flush(hdev);
1355 do_inquiry = 1;
1356 }
1357 hci_dev_unlock(hdev);
1358
1359 timeo = ir.length * msecs_to_jiffies(2000);
1360
1361 if (do_inquiry) {
1362 err = hci_req_sync(hdev, hci_inq_req, (unsigned long) &ir,
1363 timeo, NULL);
1364 if (err < 0)
1365 goto done;
1366
1367 /* Wait until Inquiry procedure finishes (HCI_INQUIRY flag is
1368 * cleared). If it is interrupted by a signal, return -EINTR.
1369 */
1370 if (wait_on_bit(&hdev->flags, HCI_INQUIRY,
1371 TASK_INTERRUPTIBLE)) {
1372 err = -EINTR;
1373 goto done;
1374 }
1375 }
1376
1377 /* for unlimited number of responses we will use buffer with
1378 * 255 entries
1379 */
1380 max_rsp = (ir.num_rsp == 0) ? 255 : ir.num_rsp;
1381
1382 /* cache_dump can't sleep. Therefore we allocate temp buffer and then
1383 * copy it to the user space.
1384 */
1385 buf = kmalloc_array(max_rsp, sizeof(struct inquiry_info), GFP_KERNEL);
1386 if (!buf) {
1387 err = -ENOMEM;
1388 goto done;
1389 }
1390
1391 hci_dev_lock(hdev);
1392 ir.num_rsp = inquiry_cache_dump(hdev, max_rsp, buf);
1393 hci_dev_unlock(hdev);
1394
1395 BT_DBG("num_rsp %d", ir.num_rsp);
1396
1397 if (!copy_to_user(ptr, &ir, sizeof(ir))) {
1398 ptr += sizeof(ir);
1399 if (copy_to_user(ptr, buf, sizeof(struct inquiry_info) *
1400 ir.num_rsp))
1401 err = -EFAULT;
1402 } else
1403 err = -EFAULT;
1404
1405 kfree(buf);
1406
1407 done:
1408 hci_dev_put(hdev);
1409 return err;
1410 }
1411
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month