[linux-next:master 7267/7959] drivers/firmware/arm_scmi/driver.c:1214 scmi_iterator_run() warn: variable dereferenced before check 'i' (see line 1210)
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm(a)kvack.org>
TO: Cristian Marussi <cristian.marussi(a)arm.com>
CC: Sudeep Holla <sudeep.holla(a)arm.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 5469f0c06732a077c70a759a81f2a1f00b277694
commit: 36b6ea0fc6bcbc618fe20d33a3b529a6d0653d99 [7267/7959] firmware: arm_scmi: Add iterators for multi-part commands
:::::: branch date: 16 hours ago
:::::: commit date: 30 hours ago
config: arm64-randconfig-m031-20220429 (https://download.01.org/0day-ci/archive/20220430/202204300741.1Vg3IhCp-lk...)
compiler: aarch64-linux-gcc (GCC) 11.3.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/firmware/arm_scmi/driver.c:1214 scmi_iterator_run() warn: variable dereferenced before check 'i' (see line 1210)
vim +/i +1214 drivers/firmware/arm_scmi/driver.c
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1204
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1205 static int scmi_iterator_run(void *iter)
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1206 {
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1207 int ret = -EINVAL;
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1208 struct scmi_iterator *i = iter;
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1209 struct scmi_iterator_state *st = &i->state;
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 @1210 struct scmi_iterator_ops *iops = i->ops;
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1211 const struct scmi_protocol_handle *ph = i->ph;
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1212 const struct scmi_xfer_ops *xops = ph->xops;
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1213
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 @1214 if (!i)
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1215 return ret;
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1216
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1217 do {
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1218 iops->prepare_message(i->msg, st->desc_index, i->priv);
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1219 ret = xops->do_xfer(ph, i->t);
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1220 if (ret)
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1221 break;
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1222
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1223 ret = iops->update_state(st, i->resp, i->priv);
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1224 if (ret)
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1225 break;
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1226
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1227 if (st->num_returned > st->max_resources - st->desc_index) {
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1228 dev_err(ph->dev,
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1229 "No. of resources can't exceed %d\n",
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1230 st->max_resources);
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1231 ret = -EINVAL;
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1232 break;
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1233 }
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1234
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1235 for (st->loop_idx = 0; st->loop_idx < st->num_returned;
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1236 st->loop_idx++) {
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1237 ret = iops->process_response(ph, i->resp, st, i->priv);
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1238 if (ret)
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1239 goto out;
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1240 }
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1241
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1242 st->desc_index += st->num_returned;
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1243 xops->reset_rx_to_maxsz(ph, i->t);
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1244 /*
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1245 * check for both returned and remaining to avoid infinite
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1246 * loop due to buggy firmware
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1247 */
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1248 } while (st->num_returned && st->num_remaining);
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1249
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1250 out:
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1251 /* Finalize and destroy iterator */
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1252 xops->xfer_put(ph, i->t);
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1253 devm_kfree(ph->dev, i);
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1254
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1255 return ret;
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1256 }
36b6ea0fc6bcbc Cristian Marussi 2022-03-30 1257
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months, 2 weeks
[linux-next:master 7270/7959] drivers/firmware/arm_scmi/clock.c:242:40: warning: Variable 'msg' is not assigned a value. [unassignedVariable]
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm(a)kvack.org>
TO: Cristian Marussi <cristian.marussi(a)arm.com>
CC: Sudeep Holla <sudeep.holla(a)arm.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 5469f0c06732a077c70a759a81f2a1f00b277694
commit: 7bc7caafe6b1e5b882255a42bc1bf112fa87b69b [7270/7959] firmware: arm_scmi: Use common iterators in the clock protocol
:::::: branch date: 16 hours ago
:::::: commit date: 30 hours ago
compiler: mips64-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
# apt-get install cppcheck
git checkout 7bc7caafe6b1e5b882255a42bc1bf112fa87b69b
cppcheck --quiet --enable=style,performance,portability --template=gcc FILE
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> drivers/firmware/arm_scmi/clock.c:242:40: warning: Variable 'msg' is not assigned a value. [unassignedVariable]
struct scmi_msg_clock_describe_rates *msg;
^
--
>> drivers/firmware/arm_scmi/sensors.c:341:48: warning: Variable 'msg' is not assigned a value. [unassignedVariable]
struct scmi_msg_sensor_list_update_intervals *msg;
^
drivers/firmware/arm_scmi/sensors.c:462:47: warning: Variable 'msg' is not assigned a value. [unassignedVariable]
struct scmi_msg_sensor_axis_description_get *msg;
^
drivers/firmware/arm_scmi/sensors.c:484:47: warning: Variable 'msg' is not assigned a value. [unassignedVariable]
struct scmi_msg_sensor_axis_description_get *msg;
^
vim +/msg +242 drivers/firmware/arm_scmi/clock.c
9724722fde8f9bb Sudeep Holla 2020-10-12 234
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 235 static int
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 236 scmi_clock_describe_rates_get(const struct scmi_protocol_handle *ph, u32 clk_id,
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 237 struct scmi_clock_info *clk)
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 238 {
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 239 int ret;
5f6c6430e904d21 Sudeep Holla 2017-06-06 240
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 241 void *iter;
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 @242 struct scmi_msg_clock_describe_rates *msg;
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 243 struct scmi_iterator_ops ops = {
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 244 .prepare_message = iter_clk_describe_prepare_message,
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 245 .update_state = iter_clk_describe_update_state,
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 246 .process_response = iter_clk_describe_process_response,
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 247 };
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 248 struct scmi_clk_ipriv cpriv = {
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 249 .clk_id = clk_id,
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 250 .clk = clk,
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 251 };
5f6c6430e904d21 Sudeep Holla 2017-06-06 252
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 253 iter = ph->hops->iter_response_init(ph, &ops, SCMI_MAX_NUM_RATES,
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 254 CLOCK_DESCRIBE_RATES,
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 255 sizeof(*msg), &cpriv);
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 256 if (IS_ERR(iter))
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 257 return PTR_ERR(iter);
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 258
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 259 ret = ph->hops->iter_response_run(iter);
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 260 if (ret)
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 261 return ret;
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 262
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 263 if (!clk->rate_discrete) {
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 264 dev_dbg(ph->dev, "Min %llu Max %llu Step %llu Hz\n",
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 265 clk->range.min_rate, clk->range.max_rate,
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 266 clk->range.step_size);
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 267 } else if (clk->list.num_rates) {
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 268 sort(clk->list.rates, clk->list.num_rates,
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 269 sizeof(clk->list.rates[0]), rate_cmp_func, NULL);
7bc7caafe6b1e5b Cristian Marussi 2022-03-30 270 }
c0759b9b5d411ab Peng Fan 2019-05-22 271
5f6c6430e904d21 Sudeep Holla 2017-06-06 272 return ret;
5f6c6430e904d21 Sudeep Holla 2017-06-06 273 }
5f6c6430e904d21 Sudeep Holla 2017-06-06 274
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months, 2 weeks
[hnaz-mm:master 291/410] mm/mmap.c:850 __vma_adjust() error: uninitialized symbol 'next_next'.
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: "Liam R. Howlett" <Liam.Howlett(a)Oracle.com>
CC: Johannes Weiner <hannes(a)cmpxchg.org>
CC: Andrew Morton <akpm(a)linux-foundation.org>
CC: Linux Memory Management List <linux-mm(a)kvack.org>
tree: https://github.com/hnaz/linux-mm master
head: bf4803abaa3e9d2fa207c0675a2d2abf0fd44f66
commit: 48c8a6f751a2c87c2dcfa40442e0ebe3afd7cd76 [291/410] mm: remove rb tree.
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: x86_64-randconfig-m001-20220425 (https://download.01.org/0day-ci/archive/20220430/202204300714.hs00NRDM-lk...)
compiler: gcc-11 (Debian 11.2.0-20) 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:
mm/mmap.c:850 __vma_adjust() error: uninitialized symbol 'next_next'.
vim +/next_next +850 mm/mmap.c
^1da177e4c3f415 Linus Torvalds 2005-04-16 608
^1da177e4c3f415 Linus Torvalds 2005-04-16 609 /*
^1da177e4c3f415 Linus Torvalds 2005-04-16 610 * We cannot adjust vm_start, vm_end, vm_pgoff fields of a vma that
^1da177e4c3f415 Linus Torvalds 2005-04-16 611 * is already present in an i_mmap tree without adjusting the tree.
^1da177e4c3f415 Linus Torvalds 2005-04-16 612 * The following helper function should be used when such adjustments
^1da177e4c3f415 Linus Torvalds 2005-04-16 613 * are necessary. The "insert" vma (if any) is to be inserted
^1da177e4c3f415 Linus Torvalds 2005-04-16 614 * before we drop the necessary locks.
^1da177e4c3f415 Linus Torvalds 2005-04-16 615 */
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 616 int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 617 unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert,
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 618 struct vm_area_struct *expand)
^1da177e4c3f415 Linus Torvalds 2005-04-16 619 {
^1da177e4c3f415 Linus Torvalds 2005-04-16 620 struct mm_struct *mm = vma->vm_mm;
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 621 struct vm_area_struct *next_next, *next = find_vma(mm, vma->vm_end);
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 622 struct vm_area_struct *orig_vma = vma;
^1da177e4c3f415 Linus Torvalds 2005-04-16 623 struct address_space *mapping = NULL;
f808c13fd373894 Davidlohr Bueso 2017-09-08 624 struct rb_root_cached *root = NULL;
012f18004da33ba Rik van Riel 2010-08-09 625 struct anon_vma *anon_vma = NULL;
^1da177e4c3f415 Linus Torvalds 2005-04-16 626 struct file *file = vma->vm_file;
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 627 bool vma_changed = false;
^1da177e4c3f415 Linus Torvalds 2005-04-16 628 long adjust_next = 0;
^1da177e4c3f415 Linus Torvalds 2005-04-16 629 int remove_next = 0;
f90a08f5f1a5029 Liam R. Howlett 2022-04-26 630 MA_STATE(mas, &mm->mm_mt, 0, 0);
734537c9cb725fc Kirill A. Shutemov 2016-07-28 631 struct vm_area_struct *exporter = NULL, *importer = NULL;
287d97ac0321367 Linus Torvalds 2010-04-10 632
f90a08f5f1a5029 Liam R. Howlett 2022-04-26 633 if (next && !insert) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 634 if (end >= next->vm_end) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 635 /*
^1da177e4c3f415 Linus Torvalds 2005-04-16 636 * vma expands, overlapping all the next, and
^1da177e4c3f415 Linus Torvalds 2005-04-16 637 * perhaps the one after too (mprotect case 6).
86d12e471d9f152 Andrea Arcangeli 2016-10-07 638 * The only other cases that gets here are
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 639 * case 1, case 7 and case 8.
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 640 */
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 641 if (next == expand) {
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 642 /*
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 643 * The only case where we don't expand "vma"
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 644 * and we expand "next" instead is case 8.
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 645 */
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 646 VM_WARN_ON(end != next->vm_end);
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 647 /*
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 648 * remove_next == 3 means we're
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 649 * removing "vma" and that to do so we
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 650 * swapped "vma" and "next".
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 651 */
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 652 remove_next = 3;
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 653 VM_WARN_ON(file != next->vm_file);
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 654 swap(vma, next);
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 655 } else {
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 656 VM_WARN_ON(expand != vma);
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 657 /*
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 658 * case 1, 6, 7, remove_next == 2 is case 6,
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 659 * remove_next == 1 is case 1 or 7.
^1da177e4c3f415 Linus Torvalds 2005-04-16 660 */
734537c9cb725fc Kirill A. Shutemov 2016-07-28 661 remove_next = 1 + (end > next->vm_end);
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 662 next_next = find_vma(mm, next->vm_end);
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 663 VM_WARN_ON(remove_next == 2 &&
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 664 end != next_next->vm_end);
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 665 /* trim end to next, for case 6 first pass */
^1da177e4c3f415 Linus Torvalds 2005-04-16 666 end = next->vm_end;
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 667 }
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 668
287d97ac0321367 Linus Torvalds 2010-04-10 669 exporter = next;
^1da177e4c3f415 Linus Torvalds 2005-04-16 670 importer = vma;
734537c9cb725fc Kirill A. Shutemov 2016-07-28 671
734537c9cb725fc Kirill A. Shutemov 2016-07-28 672 /*
734537c9cb725fc Kirill A. Shutemov 2016-07-28 673 * If next doesn't have anon_vma, import from vma after
734537c9cb725fc Kirill A. Shutemov 2016-07-28 674 * next, if the vma overlaps with it.
734537c9cb725fc Kirill A. Shutemov 2016-07-28 675 */
97a42cd4398162a Andrea Arcangeli 2016-10-07 676 if (remove_next == 2 && !next->anon_vma)
734537c9cb725fc Kirill A. Shutemov 2016-07-28 677 exporter = next->vm_next;
734537c9cb725fc Kirill A. Shutemov 2016-07-28 678
^1da177e4c3f415 Linus Torvalds 2005-04-16 679 } else if (end > next->vm_start) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 680 /*
^1da177e4c3f415 Linus Torvalds 2005-04-16 681 * vma expands, overlapping part of the next:
^1da177e4c3f415 Linus Torvalds 2005-04-16 682 * mprotect case 5 shifting the boundary up.
^1da177e4c3f415 Linus Torvalds 2005-04-16 683 */
f9d86a60572295e Wei Yang 2020-10-13 684 adjust_next = (end - next->vm_start);
287d97ac0321367 Linus Torvalds 2010-04-10 685 exporter = next;
^1da177e4c3f415 Linus Torvalds 2005-04-16 686 importer = vma;
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 687 VM_WARN_ON(expand != importer);
^1da177e4c3f415 Linus Torvalds 2005-04-16 688 } else if (end < vma->vm_end) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 689 /*
^1da177e4c3f415 Linus Torvalds 2005-04-16 690 * vma shrinks, and !insert tells it's not
^1da177e4c3f415 Linus Torvalds 2005-04-16 691 * split_vma inserting another: so it must be
^1da177e4c3f415 Linus Torvalds 2005-04-16 692 * mprotect case 4 shifting the boundary down.
^1da177e4c3f415 Linus Torvalds 2005-04-16 693 */
f9d86a60572295e Wei Yang 2020-10-13 694 adjust_next = -(vma->vm_end - end);
287d97ac0321367 Linus Torvalds 2010-04-10 695 exporter = vma;
^1da177e4c3f415 Linus Torvalds 2005-04-16 696 importer = next;
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 697 VM_WARN_ON(expand != importer);
^1da177e4c3f415 Linus Torvalds 2005-04-16 698 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 699
5beb49305251e56 Rik van Riel 2010-03-05 700 /*
5beb49305251e56 Rik van Riel 2010-03-05 701 * Easily overlooked: when mprotect shifts the boundary,
5beb49305251e56 Rik van Riel 2010-03-05 702 * make sure the expanding vma has anon_vma set if the
5beb49305251e56 Rik van Riel 2010-03-05 703 * shrinking vma had, to cover any anon pages imported.
5beb49305251e56 Rik van Riel 2010-03-05 704 */
287d97ac0321367 Linus Torvalds 2010-04-10 705 if (exporter && exporter->anon_vma && !importer->anon_vma) {
c4ea95d7cd08d9f Daniel Forrest 2014-12-02 706 int error;
c4ea95d7cd08d9f Daniel Forrest 2014-12-02 707
b800c91a0517071 Konstantin Khlebnikov 2015-01-11 708 importer->anon_vma = exporter->anon_vma;
c4ea95d7cd08d9f Daniel Forrest 2014-12-02 709 error = anon_vma_clone(importer, exporter);
3fe89b3e2a7bbf3 Leon Yu 2015-03-25 710 if (error)
c4ea95d7cd08d9f Daniel Forrest 2014-12-02 711 return error;
b800c91a0517071 Konstantin Khlebnikov 2015-01-11 712 }
5beb49305251e56 Rik van Riel 2010-03-05 713 }
734537c9cb725fc Kirill A. Shutemov 2016-07-28 714 again:
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 715 vma_adjust_trans_huge(orig_vma, start, end, adjust_next);
37f9f5595c26d3c Kirill A. Shutemov 2016-07-26 716
f90a08f5f1a5029 Liam R. Howlett 2022-04-26 717 if (mas_preallocate(&mas, vma, GFP_KERNEL)) {
f90a08f5f1a5029 Liam R. Howlett 2022-04-26 718 if (exporter && exporter->anon_vma)
f90a08f5f1a5029 Liam R. Howlett 2022-04-26 719 unlink_anon_vmas(importer);
f90a08f5f1a5029 Liam R. Howlett 2022-04-26 720 return -ENOMEM;
f90a08f5f1a5029 Liam R. Howlett 2022-04-26 721 }
f90a08f5f1a5029 Liam R. Howlett 2022-04-26 722
^1da177e4c3f415 Linus Torvalds 2005-04-16 723 if (file) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 724 mapping = file->f_mapping;
^1da177e4c3f415 Linus Torvalds 2005-04-16 725 root = &mapping->i_mmap;
cbc91f71b51b833 Srikar Dronamraju 2012-04-11 726 uprobe_munmap(vma, vma->vm_start, vma->vm_end);
682968e0c425c60 Srikar Dronamraju 2012-03-30 727
682968e0c425c60 Srikar Dronamraju 2012-03-30 728 if (adjust_next)
27ba0644ea9dfe6 Kirill A. Shutemov 2015-02-10 729 uprobe_munmap(next, next->vm_start, next->vm_end);
682968e0c425c60 Srikar Dronamraju 2012-03-30 730
83cde9e8ba95d18 Davidlohr Bueso 2014-12-12 731 i_mmap_lock_write(mapping);
^1da177e4c3f415 Linus Torvalds 2005-04-16 732 if (insert) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 733 /*
6b2dbba8b6ac4df Michel Lespinasse 2012-10-08 734 * Put into interval tree now, so instantiated pages
^1da177e4c3f415 Linus Torvalds 2005-04-16 735 * are visible to arm/parisc __flush_dcache_page
^1da177e4c3f415 Linus Torvalds 2005-04-16 736 * throughout; but we cannot insert into address
^1da177e4c3f415 Linus Torvalds 2005-04-16 737 * space until vma start or end is updated.
^1da177e4c3f415 Linus Torvalds 2005-04-16 738 */
^1da177e4c3f415 Linus Torvalds 2005-04-16 739 __vma_link_file(insert);
^1da177e4c3f415 Linus Torvalds 2005-04-16 740 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 741 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 742
012f18004da33ba Rik van Riel 2010-08-09 743 anon_vma = vma->anon_vma;
bf181b9f9d8dfbb Michel Lespinasse 2012-10-08 744 if (!anon_vma && adjust_next)
bf181b9f9d8dfbb Michel Lespinasse 2012-10-08 745 anon_vma = next->anon_vma;
bf181b9f9d8dfbb Michel Lespinasse 2012-10-08 746 if (anon_vma) {
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 747 VM_WARN_ON(adjust_next && next->anon_vma &&
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 748 anon_vma != next->anon_vma);
4fc3f1d66b1ef0d Ingo Molnar 2012-12-02 749 anon_vma_lock_write(anon_vma);
bf181b9f9d8dfbb Michel Lespinasse 2012-10-08 750 anon_vma_interval_tree_pre_update_vma(vma);
bf181b9f9d8dfbb Michel Lespinasse 2012-10-08 751 if (adjust_next)
bf181b9f9d8dfbb Michel Lespinasse 2012-10-08 752 anon_vma_interval_tree_pre_update_vma(next);
bf181b9f9d8dfbb Michel Lespinasse 2012-10-08 753 }
012f18004da33ba Rik van Riel 2010-08-09 754
0fc48a6e213ab8e Wei Yang 2020-10-13 755 if (file) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 756 flush_dcache_mmap_lock(mapping);
6b2dbba8b6ac4df Michel Lespinasse 2012-10-08 757 vma_interval_tree_remove(vma, root);
^1da177e4c3f415 Linus Torvalds 2005-04-16 758 if (adjust_next)
6b2dbba8b6ac4df Michel Lespinasse 2012-10-08 759 vma_interval_tree_remove(next, root);
^1da177e4c3f415 Linus Torvalds 2005-04-16 760 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 761
d37371870ceb1d2 Michel Lespinasse 2012-12-11 762 if (start != vma->vm_start) {
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 763 if (vma->vm_start < start)
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 764 vma_mt_szero(mm, vma->vm_start, start);
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 765 else
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 766 vma_changed = true;
^1da177e4c3f415 Linus Torvalds 2005-04-16 767 vma->vm_start = start;
d37371870ceb1d2 Michel Lespinasse 2012-12-11 768 }
d37371870ceb1d2 Michel Lespinasse 2012-12-11 769 if (end != vma->vm_end) {
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 770 if (vma->vm_end > end)
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 771 vma_mt_szero(mm, end, vma->vm_end);
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 772 else
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 773 vma_changed = true;
^1da177e4c3f415 Linus Torvalds 2005-04-16 774 vma->vm_end = end;
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 775 if (!next)
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 776 mm->highest_vm_end = vm_end_gap(vma);
d37371870ceb1d2 Michel Lespinasse 2012-12-11 777 }
f90a08f5f1a5029 Liam R. Howlett 2022-04-26 778
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 779 if (vma_changed)
f90a08f5f1a5029 Liam R. Howlett 2022-04-26 780 vma_mas_store(vma, &mas);
f90a08f5f1a5029 Liam R. Howlett 2022-04-26 781
^1da177e4c3f415 Linus Torvalds 2005-04-16 782 vma->vm_pgoff = pgoff;
^1da177e4c3f415 Linus Torvalds 2005-04-16 783 if (adjust_next) {
f9d86a60572295e Wei Yang 2020-10-13 784 next->vm_start += adjust_next;
f9d86a60572295e Wei Yang 2020-10-13 785 next->vm_pgoff += adjust_next >> PAGE_SHIFT;
f90a08f5f1a5029 Liam R. Howlett 2022-04-26 786 vma_mas_store(next, &mas);
^1da177e4c3f415 Linus Torvalds 2005-04-16 787 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 788
0fc48a6e213ab8e Wei Yang 2020-10-13 789 if (file) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 790 if (adjust_next)
6b2dbba8b6ac4df Michel Lespinasse 2012-10-08 791 vma_interval_tree_insert(next, root);
6b2dbba8b6ac4df Michel Lespinasse 2012-10-08 792 vma_interval_tree_insert(vma, root);
^1da177e4c3f415 Linus Torvalds 2005-04-16 793 flush_dcache_mmap_unlock(mapping);
^1da177e4c3f415 Linus Torvalds 2005-04-16 794 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 795
^1da177e4c3f415 Linus Torvalds 2005-04-16 796 if (remove_next) {
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 797 __vma_unlink_list(mm, next);
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 798 /* Kill the cache */
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 799 vmacache_invalidate(mm);
^1da177e4c3f415 Linus Torvalds 2005-04-16 800 if (file)
^1da177e4c3f415 Linus Torvalds 2005-04-16 801 __remove_shared_vm_struct(next, file, mapping);
^1da177e4c3f415 Linus Torvalds 2005-04-16 802 } else if (insert) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 803 /*
^1da177e4c3f415 Linus Torvalds 2005-04-16 804 * split_vma has split insert from vma, and needs
^1da177e4c3f415 Linus Torvalds 2005-04-16 805 * us to insert it before dropping the locks
^1da177e4c3f415 Linus Torvalds 2005-04-16 806 * (it may either follow vma or precede it).
^1da177e4c3f415 Linus Torvalds 2005-04-16 807 */
f90a08f5f1a5029 Liam R. Howlett 2022-04-26 808 __insert_vm_struct(mm, &mas, insert);
^1da177e4c3f415 Linus Torvalds 2005-04-16 809 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 810
bf181b9f9d8dfbb Michel Lespinasse 2012-10-08 811 if (anon_vma) {
bf181b9f9d8dfbb Michel Lespinasse 2012-10-08 812 anon_vma_interval_tree_post_update_vma(vma);
bf181b9f9d8dfbb Michel Lespinasse 2012-10-08 813 if (adjust_next)
bf181b9f9d8dfbb Michel Lespinasse 2012-10-08 814 anon_vma_interval_tree_post_update_vma(next);
08b52706d505658 Konstantin Khlebnikov 2013-02-22 815 anon_vma_unlock_write(anon_vma);
bf181b9f9d8dfbb Michel Lespinasse 2012-10-08 816 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 817
0fc48a6e213ab8e Wei Yang 2020-10-13 818 if (file) {
808fbdbea05f1e9 Wei Yang 2020-10-13 819 i_mmap_unlock_write(mapping);
7b2d81d48a2d8e3 Ingo Molnar 2012-02-17 820 uprobe_mmap(vma);
2b144498350860b Srikar Dronamraju 2012-02-09 821
2b144498350860b Srikar Dronamraju 2012-02-09 822 if (adjust_next)
7b2d81d48a2d8e3 Ingo Molnar 2012-02-17 823 uprobe_mmap(next);
2b144498350860b Srikar Dronamraju 2012-02-09 824 }
2b144498350860b Srikar Dronamraju 2012-02-09 825
^1da177e4c3f415 Linus Torvalds 2005-04-16 826 if (remove_next) {
925d1c401fa6cfd Matt Helsley 2008-04-29 827 if (file) {
cbc91f71b51b833 Srikar Dronamraju 2012-04-11 828 uprobe_munmap(next, next->vm_start, next->vm_end);
^1da177e4c3f415 Linus Torvalds 2005-04-16 829 fput(file);
925d1c401fa6cfd Matt Helsley 2008-04-29 830 }
5beb49305251e56 Rik van Riel 2010-03-05 831 if (next->anon_vma)
5beb49305251e56 Rik van Riel 2010-03-05 832 anon_vma_merge(vma, next);
^1da177e4c3f415 Linus Torvalds 2005-04-16 833 mm->map_count--;
3964acd0dbec123 Oleg Nesterov 2013-07-31 834 mpol_put(vma_policy(next));
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 835 BUG_ON(vma->vm_end < next->vm_end);
3928d4f5ee37cdc Linus Torvalds 2018-07-21 836 vm_area_free(next);
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 837
^1da177e4c3f415 Linus Torvalds 2005-04-16 838 /*
^1da177e4c3f415 Linus Torvalds 2005-04-16 839 * In mprotect's case 6 (see comments on vma_merge),
^1da177e4c3f415 Linus Torvalds 2005-04-16 840 * we must remove another next too. It would clutter
^1da177e4c3f415 Linus Torvalds 2005-04-16 841 * up the code too much to do both in one go.
^1da177e4c3f415 Linus Torvalds 2005-04-16 842 */
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 843 if (remove_next != 3) {
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 844 /*
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 845 * If "next" was removed and vma->vm_end was
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 846 * expanded (up) over it, in turn
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 847 * "next->vm_prev->vm_end" changed and the
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 848 * "vma->vm_next" gap must be updated.
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 849 */
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 @850 next = next_next;
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 851 } else {
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 852 /*
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 853 * For the scope of the comment "next" and
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 854 * "vma" considered pre-swap(): if "vma" was
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 855 * removed, next->vm_start was expanded (down)
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 856 * over it and the "next" gap must be updated.
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 857 * Because of the swap() the post-swap() "vma"
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 858 * actually points to pre-swap() "next"
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 859 * (post-swap() "next" as opposed is now a
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 860 * dangling pointer).
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 861 */
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 862 next = vma;
e86f15ee64d8ee4 Andrea Arcangeli 2016-10-07 863 }
734537c9cb725fc Kirill A. Shutemov 2016-07-28 864 if (remove_next == 2) {
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 865 mas_reset(&mas);
734537c9cb725fc Kirill A. Shutemov 2016-07-28 866 remove_next = 1;
734537c9cb725fc Kirill A. Shutemov 2016-07-28 867 end = next->vm_end;
^1da177e4c3f415 Linus Torvalds 2005-04-16 868 goto again;
48c8a6f751a2c87 Liam R. Howlett 2022-04-26 869 } else if (!next) {
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 870 /*
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 871 * If remove_next == 2 we obviously can't
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 872 * reach this path.
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 873 *
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 874 * If remove_next == 3 we can't reach this
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 875 * path because pre-swap() next is always not
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 876 * NULL. pre-swap() "next" is not being
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 877 * removed and its next->vm_end is not altered
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 878 * (and furthermore "end" already matches
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 879 * next->vm_end in remove_next == 3).
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 880 *
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 881 * We reach this only in the remove_next == 1
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 882 * case if the "next" vma that was removed was
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 883 * the highest vma of the mm. However in such
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 884 * case next->vm_end == "end" and the extended
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 885 * "vma" has vma->vm_end == next->vm_end so
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 886 * mm->highest_vm_end doesn't need any update
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 887 * in remove_next == 1 case.
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 888 */
1be7107fbe18eed Hugh Dickins 2017-06-19 889 VM_WARN_ON(mm->highest_vm_end != vm_end_gap(vma));
fb8c41e9ad1f356 Andrea Arcangeli 2016-10-07 890 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 891 }
2b144498350860b Srikar Dronamraju 2012-02-09 892 if (insert && file)
7b2d81d48a2d8e3 Ingo Molnar 2012-02-17 893 uprobe_mmap(insert);
^1da177e4c3f415 Linus Torvalds 2005-04-16 894
^1da177e4c3f415 Linus Torvalds 2005-04-16 895 validate_mm(mm);
5beb49305251e56 Rik van Riel 2010-03-05 896 return 0;
^1da177e4c3f415 Linus Torvalds 2005-04-16 897 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 898
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months, 2 weeks
fs/ksmbd/oplock.c:988 find_same_lease_key() warn: missing error code 'err'
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Namjae Jeon <namjae.jeon(a)samsung.com>
CC: Christoph Hellwig <hch(a)lst.de>
CC: Steve French <stfrench(a)microsoft.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 2d0de93ca2515958e717138e5ee07ec3b6bf0226
commit: 1a93084b9a89818aec0ac7b59a5a51f2112bf203 ksmbd: move fs/cifsd to fs/ksmbd
date: 10 months ago
:::::: branch date: 5 hours ago
:::::: commit date: 10 months ago
config: nios2-randconfig-m031-20220428 (https://download.01.org/0day-ci/archive/20220430/202204300628.lxnNtMag-lk...)
compiler: nios2-linux-gcc (GCC) 11.3.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:
fs/ksmbd/oplock.c:988 find_same_lease_key() warn: missing error code 'err'
vim +/err +988 fs/ksmbd/oplock.c
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 955
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 956 int find_same_lease_key(struct ksmbd_session *sess, struct ksmbd_inode *ci,
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 957 struct lease_ctx_info *lctx)
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 958 {
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 959 struct oplock_info *opinfo;
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 960 int err = 0;
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 961 struct lease_table *lb;
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 962
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 963 if (!lctx)
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 964 return err;
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 965
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 966 read_lock(&lease_list_lock);
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 967 if (list_empty(&lease_table_list)) {
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 968 read_unlock(&lease_list_lock);
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 969 return 0;
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 970 }
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 971
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 972 list_for_each_entry(lb, &lease_table_list, l_entry) {
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 973 if (!memcmp(lb->client_guid, sess->conn->ClientGUID,
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 974 SMB2_CLIENT_GUID_SIZE))
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 975 goto found;
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 976 }
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 977 read_unlock(&lease_list_lock);
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 978
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 979 return 0;
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 980
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 981 found:
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 982 rcu_read_lock();
070fb21e5912b6a fs/cifsd/oplock.c Namjae Jeon 2021-05-26 983 list_for_each_entry_rcu(opinfo, &lb->lease_list, lease_entry) {
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 984 if (!atomic_inc_not_zero(&opinfo->refcount))
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 985 continue;
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 986 rcu_read_unlock();
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 987 if (opinfo->o_fp->f_ci == ci)
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 @988 goto op_next;
070fb21e5912b6a fs/cifsd/oplock.c Namjae Jeon 2021-05-26 989 err = compare_guid_key(opinfo, sess->conn->ClientGUID,
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 990 lctx->lease_key);
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 991 if (err) {
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 992 err = -EINVAL;
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 993 ksmbd_debug(OPLOCK,
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 994 "found same lease key is already used in other files\n");
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 995 opinfo_put(opinfo);
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 996 goto out;
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 997 }
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 998 op_next:
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 999 opinfo_put(opinfo);
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 1000 rcu_read_lock();
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 1001 }
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 1002 rcu_read_unlock();
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 1003
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 1004 out:
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 1005 read_unlock(&lease_list_lock);
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 1006 return err;
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 1007 }
e2f34481b24db2f fs/cifsd/oplock.c Namjae Jeon 2021-03-16 1008
:::::: The code at line 988 was first introduced by commit
:::::: e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 cifsd: add server-side procedures for SMB3
:::::: TO: Namjae Jeon <namjae.jeon(a)samsung.com>
:::::: CC: Steve French <stfrench(a)microsoft.com>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months, 2 weeks
[linux-next:master 1683/7959] drivers/net/ethernet/mediatek/mtk_wed.c:813:2-8: ERROR: missing put_device; call of_find_device_by_node on line 806, but without a corresponding object release within this function.
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm(a)kvack.org>
TO: Felix Fietkau <nbd(a)nbd.name>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 5469f0c06732a077c70a759a81f2a1f00b277694
commit: 804775dfc2885e93a0a4b35db1914c2cc25172b5 [1683/7959] net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)
:::::: branch date: 7 hours ago
:::::: commit date: 3 weeks ago
config: arm64-randconfig-c004-20220428 (https://download.01.org/0day-ci/archive/20220429/202204292241.RP7yyzWn-lk...)
compiler: aarch64-linux-gcc (GCC) 11.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Julia Lawall <julia.lawall(a)lip6.fr>
cocci warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/mediatek/mtk_wed.c:813:2-8: ERROR: missing put_device; call of_find_device_by_node on line 806, but without a corresponding object release within this function.
drivers/net/ethernet/mediatek/mtk_wed.c:817:2-8: ERROR: missing put_device; call of_find_device_by_node on line 806, but without a corresponding object release within this function.
drivers/net/ethernet/mediatek/mtk_wed.c:853:0-1: ERROR: missing put_device; call of_find_device_by_node on line 806, but without a corresponding object release within this function.
vim +813 drivers/net/ethernet/mediatek/mtk_wed.c
804775dfc2885e9 Felix Fietkau 2022-04-05 780
804775dfc2885e9 Felix Fietkau 2022-04-05 781 void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
804775dfc2885e9 Felix Fietkau 2022-04-05 782 void __iomem *wdma, int index)
804775dfc2885e9 Felix Fietkau 2022-04-05 783 {
804775dfc2885e9 Felix Fietkau 2022-04-05 784 static const struct mtk_wed_ops wed_ops = {
804775dfc2885e9 Felix Fietkau 2022-04-05 785 .attach = mtk_wed_attach,
804775dfc2885e9 Felix Fietkau 2022-04-05 786 .tx_ring_setup = mtk_wed_tx_ring_setup,
804775dfc2885e9 Felix Fietkau 2022-04-05 787 .txfree_ring_setup = mtk_wed_txfree_ring_setup,
804775dfc2885e9 Felix Fietkau 2022-04-05 788 .start = mtk_wed_start,
804775dfc2885e9 Felix Fietkau 2022-04-05 789 .stop = mtk_wed_stop,
804775dfc2885e9 Felix Fietkau 2022-04-05 790 .reset_dma = mtk_wed_reset_dma,
804775dfc2885e9 Felix Fietkau 2022-04-05 791 .reg_read = wed_r32,
804775dfc2885e9 Felix Fietkau 2022-04-05 792 .reg_write = wed_w32,
804775dfc2885e9 Felix Fietkau 2022-04-05 793 .irq_get = mtk_wed_irq_get,
804775dfc2885e9 Felix Fietkau 2022-04-05 794 .irq_set_mask = mtk_wed_irq_set_mask,
804775dfc2885e9 Felix Fietkau 2022-04-05 795 .detach = mtk_wed_detach,
804775dfc2885e9 Felix Fietkau 2022-04-05 796 };
804775dfc2885e9 Felix Fietkau 2022-04-05 797 struct device_node *eth_np = eth->dev->of_node;
804775dfc2885e9 Felix Fietkau 2022-04-05 798 struct platform_device *pdev;
804775dfc2885e9 Felix Fietkau 2022-04-05 799 struct mtk_wed_hw *hw;
804775dfc2885e9 Felix Fietkau 2022-04-05 800 struct regmap *regs;
804775dfc2885e9 Felix Fietkau 2022-04-05 801 int irq;
804775dfc2885e9 Felix Fietkau 2022-04-05 802
804775dfc2885e9 Felix Fietkau 2022-04-05 803 if (!np)
804775dfc2885e9 Felix Fietkau 2022-04-05 804 return;
804775dfc2885e9 Felix Fietkau 2022-04-05 805
804775dfc2885e9 Felix Fietkau 2022-04-05 @806 pdev = of_find_device_by_node(np);
804775dfc2885e9 Felix Fietkau 2022-04-05 807 if (!pdev)
804775dfc2885e9 Felix Fietkau 2022-04-05 808 return;
804775dfc2885e9 Felix Fietkau 2022-04-05 809
804775dfc2885e9 Felix Fietkau 2022-04-05 810 get_device(&pdev->dev);
804775dfc2885e9 Felix Fietkau 2022-04-05 811 irq = platform_get_irq(pdev, 0);
804775dfc2885e9 Felix Fietkau 2022-04-05 812 if (irq < 0)
804775dfc2885e9 Felix Fietkau 2022-04-05 @813 return;
804775dfc2885e9 Felix Fietkau 2022-04-05 814
804775dfc2885e9 Felix Fietkau 2022-04-05 815 regs = syscon_regmap_lookup_by_phandle(np, NULL);
804775dfc2885e9 Felix Fietkau 2022-04-05 816 if (!regs)
804775dfc2885e9 Felix Fietkau 2022-04-05 817 return;
804775dfc2885e9 Felix Fietkau 2022-04-05 818
804775dfc2885e9 Felix Fietkau 2022-04-05 819 rcu_assign_pointer(mtk_soc_wed_ops, &wed_ops);
804775dfc2885e9 Felix Fietkau 2022-04-05 820
804775dfc2885e9 Felix Fietkau 2022-04-05 821 mutex_lock(&hw_lock);
804775dfc2885e9 Felix Fietkau 2022-04-05 822
804775dfc2885e9 Felix Fietkau 2022-04-05 823 if (WARN_ON(hw_list[index]))
804775dfc2885e9 Felix Fietkau 2022-04-05 824 goto unlock;
804775dfc2885e9 Felix Fietkau 2022-04-05 825
804775dfc2885e9 Felix Fietkau 2022-04-05 826 hw = kzalloc(sizeof(*hw), GFP_KERNEL);
804775dfc2885e9 Felix Fietkau 2022-04-05 827 hw->node = np;
804775dfc2885e9 Felix Fietkau 2022-04-05 828 hw->regs = regs;
804775dfc2885e9 Felix Fietkau 2022-04-05 829 hw->eth = eth;
804775dfc2885e9 Felix Fietkau 2022-04-05 830 hw->dev = &pdev->dev;
804775dfc2885e9 Felix Fietkau 2022-04-05 831 hw->wdma = wdma;
804775dfc2885e9 Felix Fietkau 2022-04-05 832 hw->index = index;
804775dfc2885e9 Felix Fietkau 2022-04-05 833 hw->irq = irq;
804775dfc2885e9 Felix Fietkau 2022-04-05 834 hw->mirror = syscon_regmap_lookup_by_phandle(eth_np,
804775dfc2885e9 Felix Fietkau 2022-04-05 835 "mediatek,pcie-mirror");
804775dfc2885e9 Felix Fietkau 2022-04-05 836 hw->hifsys = syscon_regmap_lookup_by_phandle(eth_np,
804775dfc2885e9 Felix Fietkau 2022-04-05 837 "mediatek,hifsys");
804775dfc2885e9 Felix Fietkau 2022-04-05 838 if (IS_ERR(hw->mirror) || IS_ERR(hw->hifsys)) {
804775dfc2885e9 Felix Fietkau 2022-04-05 839 kfree(hw);
804775dfc2885e9 Felix Fietkau 2022-04-05 840 goto unlock;
804775dfc2885e9 Felix Fietkau 2022-04-05 841 }
804775dfc2885e9 Felix Fietkau 2022-04-05 842
804775dfc2885e9 Felix Fietkau 2022-04-05 843 if (!index) {
804775dfc2885e9 Felix Fietkau 2022-04-05 844 regmap_write(hw->mirror, 0, 0);
804775dfc2885e9 Felix Fietkau 2022-04-05 845 regmap_write(hw->mirror, 4, 0);
804775dfc2885e9 Felix Fietkau 2022-04-05 846 }
804775dfc2885e9 Felix Fietkau 2022-04-05 847 mtk_wed_hw_add_debugfs(hw);
804775dfc2885e9 Felix Fietkau 2022-04-05 848
804775dfc2885e9 Felix Fietkau 2022-04-05 849 hw_list[index] = hw;
804775dfc2885e9 Felix Fietkau 2022-04-05 850
804775dfc2885e9 Felix Fietkau 2022-04-05 851 unlock:
804775dfc2885e9 Felix Fietkau 2022-04-05 852 mutex_unlock(&hw_lock);
804775dfc2885e9 Felix Fietkau 2022-04-05 853 }
804775dfc2885e9 Felix Fietkau 2022-04-05 854
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months, 2 weeks
[linux-next:master 5845/7959] drivers/gpu/drm/display/drm_dp_aux_dev.c:251:76: warning: Parameter 'aux' can be declared with const [constParameter]
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm(a)kvack.org>
TO: Thomas Zimmermann <tzimmermann(a)suse.de>
CC: Lyude Paul <lyude(a)redhat.com>
CC: Javier Martinez Canillas <javierm(a)redhat.com>
CC: Alex Deucher <alexander.deucher(a)amd.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 5469f0c06732a077c70a759a81f2a1f00b277694
commit: da68386d9edb1f57abf886febe5c5169ebd4d2c9 [5845/7959] drm: Rename dp/ to display/
:::::: branch date: 7 hours ago
:::::: commit date: 4 days ago
compiler: sparc64-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
# apt-get install cppcheck
git checkout da68386d9edb1f57abf886febe5c5169ebd4d2c9
cppcheck --quiet --enable=style,performance,portability --template=gcc FILE
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> drivers/gpu/drm/drm_mipi_dsi.c:307:73: warning: Parameter 'node' can be declared with const [constParameter]
struct mipi_dsi_host *of_find_mipi_dsi_host_by_node(struct device_node *node)
^
--
>> drivers/gpu/drm/display/drm_dp_aux_dev.c:251:76: warning: Parameter 'aux' can be declared with const [constParameter]
static struct drm_dp_aux_dev *drm_dp_aux_dev_get_by_aux(struct drm_dp_aux *aux)
^
>> drivers/gpu/drm/display/drm_dp_aux_dev.c:263:13: warning: Uninitialized variable: iter->aux [uninitvar]
if (iter->aux == aux) {
^
--
>> drivers/gpu/drm/display/drm_dp_mst_topology.c:5128:34: warning: Parameter 'branch' can be declared with const [constParameter]
struct drm_dp_mst_branch *branch)
^
vim +/aux +251 drivers/gpu/drm/display/drm_dp_aux_dev.c
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 250
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 @251 static struct drm_dp_aux_dev *drm_dp_aux_dev_get_by_aux(struct drm_dp_aux *aux)
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 252 {
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 253 struct drm_dp_aux_dev *iter, *aux_dev = NULL;
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 254 int id;
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 255
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 256 /* don't increase kref count here because this function should only be
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 257 * used by drm_dp_aux_unregister_devnode. Thus, it will always have at
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 258 * least one reference - the one that drm_dp_aux_register_devnode
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 259 * created
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 260 */
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 261 mutex_lock(&aux_idr_mutex);
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 262 idr_for_each_entry(&aux_idr, iter, id) {
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 @263 if (iter->aux == aux) {
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 264 aux_dev = iter;
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 265 break;
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 266 }
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 267 }
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 268 mutex_unlock(&aux_idr_mutex);
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 269 return aux_dev;
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 270 }
e94cb37b34eb8a8 drivers/gpu/drm/drm_dp_aux_dev.c Rafael Antognolli 2016-01-21 271
:::::: The code at line 251 was first introduced by commit
:::::: e94cb37b34eb8a88fe847438dba55c3f18bf024a drm/dp: Add a drm_aux-dev module for reading/writing dpcd registers.
:::::: TO: Rafael Antognolli <rafael.antognolli(a)intel.com>
:::::: CC: Daniel Vetter <daniel.vetter(a)ffwll.ch>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months, 2 weeks
[bvanassche:ufs-for-next 6/6] drivers/ufs/core/ufshcd.c:5430 ufshcd_uic_cmd_compl() error: we previously assumed 'priv->active_uic_cmd' could be null (see line 5418)
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Bart Van Assche <bvanassche(a)acm.org>
tree: https://github.com/bvanassche/linux ufs-for-next
head: d34bcd2acd8e932a32bf1aac6296ee8ea8d230d3
commit: d34bcd2acd8e932a32bf1aac6296ee8ea8d230d3 [6/6] scsi: ufs: Split struct ufs_hba
:::::: branch date: 18 hours ago
:::::: commit date: 18 hours ago
config: nios2-randconfig-m031-20220428 (https://download.01.org/0day-ci/archive/20220429/202204292110.C5vOQk2e-lk...)
compiler: nios2-linux-gcc (GCC) 11.3.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/ufs/core/ufshcd.c:5430 ufshcd_uic_cmd_compl() error: we previously assumed 'priv->active_uic_cmd' could be null (see line 5418)
vim +5430 drivers/ufs/core/ufshcd.c
a45f937110fa6b0 drivers/scsi/ufs/ufshcd.c Can Guo 2021-05-24 5399
6ccf44fe4cd7c45 drivers/scsi/ufs/ufshcd.c Seungwon Jeon 2013-06-26 5400 /**
6ccf44fe4cd7c45 drivers/scsi/ufs/ufshcd.c Seungwon Jeon 2013-06-26 5401 * ufshcd_uic_cmd_compl - handle completion of uic command
6ccf44fe4cd7c45 drivers/scsi/ufs/ufshcd.c Seungwon Jeon 2013-06-26 5402 * @hba: per adapter instance
53b3d9c3fdda94d drivers/scsi/ufs/ufshcd.c Seungwon Jeon 2013-08-31 5403 * @intr_status: interrupt status generated by the controller
9333d77573485c8 drivers/scsi/ufs/ufshcd.c Venkat Gopalakrishnan 2019-11-14 5404 *
9333d77573485c8 drivers/scsi/ufs/ufshcd.c Venkat Gopalakrishnan 2019-11-14 5405 * Returns
9333d77573485c8 drivers/scsi/ufs/ufshcd.c Venkat Gopalakrishnan 2019-11-14 5406 * IRQ_HANDLED - If interrupt is valid
9333d77573485c8 drivers/scsi/ufs/ufshcd.c Venkat Gopalakrishnan 2019-11-14 5407 * IRQ_NONE - If invalid interrupt
6ccf44fe4cd7c45 drivers/scsi/ufs/ufshcd.c Seungwon Jeon 2013-06-26 5408 */
9333d77573485c8 drivers/scsi/ufs/ufshcd.c Venkat Gopalakrishnan 2019-11-14 5409 static irqreturn_t ufshcd_uic_cmd_compl(struct ufs_hba *hba, u32 intr_status)
6ccf44fe4cd7c45 drivers/scsi/ufs/ufshcd.c Seungwon Jeon 2013-06-26 5410 {
d34bcd2acd8e932 drivers/ufs/core/ufshcd.c Bart Van Assche 2022-03-19 5411 struct ufs_hba_priv *priv = container_of(hba, typeof(*priv), hba);
9333d77573485c8 drivers/scsi/ufs/ufshcd.c Venkat Gopalakrishnan 2019-11-14 5412 irqreturn_t retval = IRQ_NONE;
9333d77573485c8 drivers/scsi/ufs/ufshcd.c Venkat Gopalakrishnan 2019-11-14 5413
d34bcd2acd8e932 drivers/ufs/core/ufshcd.c Bart Van Assche 2022-03-19 5414 spin_lock(priv->host->host_lock);
a45f937110fa6b0 drivers/scsi/ufs/ufshcd.c Can Guo 2021-05-24 5415 if (ufshcd_is_auto_hibern8_error(hba, intr_status))
d34bcd2acd8e932 drivers/ufs/core/ufshcd.c Bart Van Assche 2022-03-19 5416 priv->errors |= (UFSHCD_UIC_HIBERN8_MASK & intr_status);
a45f937110fa6b0 drivers/scsi/ufs/ufshcd.c Can Guo 2021-05-24 5417
d34bcd2acd8e932 drivers/ufs/core/ufshcd.c Bart Van Assche 2022-03-19 @5418 if ((intr_status & UIC_COMMAND_COMPL) && priv->active_uic_cmd) {
d34bcd2acd8e932 drivers/ufs/core/ufshcd.c Bart Van Assche 2022-03-19 5419 priv->active_uic_cmd->argument2 |=
6ccf44fe4cd7c45 drivers/scsi/ufs/ufshcd.c Seungwon Jeon 2013-06-26 5420 ufshcd_get_uic_cmd_result(hba);
d34bcd2acd8e932 drivers/ufs/core/ufshcd.c Bart Van Assche 2022-03-19 5421 priv->active_uic_cmd->argument3 =
12b4fdb4f6bccb5 drivers/scsi/ufs/ufshcd.c Seungwon Jeon 2013-08-31 5422 ufshcd_get_dme_attr_val(hba);
d34bcd2acd8e932 drivers/ufs/core/ufshcd.c Bart Van Assche 2022-03-19 5423 if (!priv->uic_async_done)
d34bcd2acd8e932 drivers/ufs/core/ufshcd.c Bart Van Assche 2022-03-19 5424 priv->active_uic_cmd->cmd_active = 0;
d34bcd2acd8e932 drivers/ufs/core/ufshcd.c Bart Van Assche 2022-03-19 5425 complete(&priv->active_uic_cmd->done);
9333d77573485c8 drivers/scsi/ufs/ufshcd.c Venkat Gopalakrishnan 2019-11-14 5426 retval = IRQ_HANDLED;
6ccf44fe4cd7c45 drivers/scsi/ufs/ufshcd.c Seungwon Jeon 2013-06-26 5427 }
53b3d9c3fdda94d drivers/scsi/ufs/ufshcd.c Seungwon Jeon 2013-08-31 5428
d34bcd2acd8e932 drivers/ufs/core/ufshcd.c Bart Van Assche 2022-03-19 5429 if ((intr_status & UFSHCD_UIC_PWR_MASK) && priv->uic_async_done) {
d34bcd2acd8e932 drivers/ufs/core/ufshcd.c Bart Van Assche 2022-03-19 @5430 priv->active_uic_cmd->cmd_active = 0;
d34bcd2acd8e932 drivers/ufs/core/ufshcd.c Bart Van Assche 2022-03-19 5431 complete(priv->uic_async_done);
9333d77573485c8 drivers/scsi/ufs/ufshcd.c Venkat Gopalakrishnan 2019-11-14 5432 retval = IRQ_HANDLED;
9333d77573485c8 drivers/scsi/ufs/ufshcd.c Venkat Gopalakrishnan 2019-11-14 5433 }
aa5c697988b4c7e drivers/scsi/ufs/ufshcd.c Stanley Chu 2020-06-15 5434
aa5c697988b4c7e drivers/scsi/ufs/ufshcd.c Stanley Chu 2020-06-15 5435 if (retval == IRQ_HANDLED)
d34bcd2acd8e932 drivers/ufs/core/ufshcd.c Bart Van Assche 2022-03-19 5436 ufshcd_add_uic_command_trace(hba, priv->active_uic_cmd,
28fa68fc557a7eb drivers/scsi/ufs/ufshcd.c Bean Huo 2021-01-05 5437 UFS_CMD_COMP);
d34bcd2acd8e932 drivers/ufs/core/ufshcd.c Bart Van Assche 2022-03-19 5438 spin_unlock(priv->host->host_lock);
9333d77573485c8 drivers/scsi/ufs/ufshcd.c Venkat Gopalakrishnan 2019-11-14 5439 return retval;
6ccf44fe4cd7c45 drivers/scsi/ufs/ufshcd.c Seungwon Jeon 2013-06-26 5440 }
6ccf44fe4cd7c45 drivers/scsi/ufs/ufshcd.c Seungwon Jeon 2013-06-26 5441
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months, 2 weeks
arch/sh/math-emu/sfp-util.h:71:9: sparse: this was the original definition
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Randy Dunlap <rdunlap(a)infradead.org>
CC: Rich Felker <dalias(a)libc.org>
CC: Geert Uytterhoeven <geert+renesas(a)glider.be>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 38d741cb70b30741c0e802cbed7bd9cf4fd15fa4
commit: b929926f01f2d14635345d22eafcf60feed1085e sh: define __BIG_ENDIAN for math-emu
date: 6 months ago
:::::: branch date: 11 hours ago
:::::: commit date: 6 months ago
config: sh-randconfig-s031-20220429 (https://download.01.org/0day-ci/archive/20220429/202204291956.5sbbX5o0-lk...)
compiler: sh4-linux-gcc (GCC) 11.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# 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 b929926f01f2d14635345d22eafcf60feed1085e
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sh SHELL=/bin/bash arch/sh/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
arch/sh/math-emu/math.c: note: in included file (through include/math-emu/soft-fp.h):
arch/sh/include/asm/sfp-machine.h:17:9: sparse: sparse: preprocessor token __BYTE_ORDER redefined
arch/sh/math-emu/math.c: note: in included file:
>> arch/sh/math-emu/sfp-util.h:71:9: sparse: this was the original definition
arch/sh/math-emu/math.c:54:9: sparse: sparse: preprocessor token WRITE redefined
arch/sh/math-emu/math.c: note: in included file:
include/linux/kernel.h:38:9: sparse: this was the original definition
arch/sh/math-emu/math.c:55:9: sparse: sparse: preprocessor token READ redefined
include/linux/kernel.h:37:9: sparse: this was the original definition
arch/sh/math-emu/math.c:122:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:122:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:122:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:122:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:122:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:122:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:122:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:122:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:122:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:122:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:129:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:129:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:129:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:129:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:145:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:145:9: sparse: sparse: asm output is not an lvalue
arch/sh/math-emu/math.c:122:9: sparse: sparse: generating address of non-lvalue (11)
arch/sh/math-emu/math.c:122:9: sparse: sparse: generating address of non-lvalue (11)
arch/sh/math-emu/math.c:122:9: sparse: sparse: generating address of non-lvalue (1)
arch/sh/math-emu/math.c:122:9: sparse: sparse: generating address of non-lvalue (1)
arch/sh/math-emu/math.c:122:9: sparse: sparse: generating address of non-lvalue (1)
arch/sh/math-emu/math.c:122:9: sparse: sparse: generating address of non-lvalue (1)
arch/sh/math-emu/math.c:122:9: sparse: sparse: generating address of non-lvalue (11)
arch/sh/math-emu/math.c:122:9: sparse: sparse: generating address of non-lvalue (11)
arch/sh/math-emu/math.c:122:9: sparse: sparse: generating address of non-lvalue (11)
arch/sh/math-emu/math.c:122:9: sparse: sparse: generating address of non-lvalue (11)
arch/sh/math-emu/math.c:129:9: sparse: sparse: generating address of non-lvalue (11)
arch/sh/math-emu/math.c:129:9: sparse: sparse: generating address of non-lvalue (11)
arch/sh/math-emu/math.c:129:9: sparse: sparse: generating address of non-lvalue (11)
arch/sh/math-emu/math.c:129:9: sparse: sparse: generating address of non-lvalue (11)
arch/sh/math-emu/math.c:145:9: sparse: sparse: generating address of non-lvalue (11)
arch/sh/math-emu/math.c:145:9: sparse: sparse: generating address of non-lvalue (11)
vim +71 arch/sh/math-emu/sfp-util.h
13da9e200fe474 Linus Torvalds 2010-05-26 70
13da9e200fe474 Linus Torvalds 2010-05-26 @71 #define __BYTE_ORDER __LITTLE_ENDIAN
:::::: The code at line 71 was first introduced by commit
:::::: 13da9e200fe4740b02cd51e07ab454627e228920 Revert "endian: #define __BYTE_ORDER"
:::::: TO: Linus Torvalds <torvalds(a)linux-foundation.org>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months, 2 weeks
[thierryreding:for-5.19/work 141/141] drivers/iommu/of_iommu.c:237:5: warning: Value stored to 'end' is never read [clang-analyzer-deadcode.DeadStores]
by kernel test robot
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Thierry Reding <treding(a)nvidia.com>
tree: https://github.com/thierryreding/linux for-5.19/work
head: a39ec325554470289e8384e30d06a22960d1dd7b
commit: a39ec325554470289e8384e30d06a22960d1dd7b [141/141] WIP
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: arm-randconfig-c002-20220428 (https://download.01.org/0day-ci/archive/20220429/202204291911.7pvsSTui-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c59473aacce38cd7dd77eebceaf3c98c5707ab3b)
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://github.com/thierryreding/linux/commit/a39ec325554470289e8384e30d0...
git remote add thierryreding https://github.com/thierryreding/linux
git fetch --no-tags thierryreding for-5.19/work
git checkout a39ec325554470289e8384e30d06a22960d1dd7b
# save the config file
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 >>)
^
include/asm-generic/bug.h:122:2: note: expanded from macro 'WARN_ON'
if (unlikely(__ret_warn_on)) \
^
fs/btrfs/ctree.c:409:6: note: Assuming 'level' is not equal to 0
if (level == 0)
^~~~~~~~~~
fs/btrfs/ctree.c:409:2: note: Taking false branch
if (level == 0)
^
fs/btrfs/ctree.c:414:7: note: Assuming the condition is true
if ((root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID) && parent)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/btrfs/ctree.c:414:6: note: Left side of '&&' is true
if ((root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID) && parent)
^
fs/btrfs/ctree.c:414:6: note: Assuming pointer value is null
if ((root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID) && parent)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/btrfs/ctree.c:414:64: note: Assuming 'parent' is null
if ((root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID) && parent)
^~~~~~
fs/btrfs/ctree.c:414:2: note: Taking false branch
if ((root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID) && parent)
^
fs/btrfs/ctree.c:420:2: note: Taking false branch
if (IS_ERR(cow))
^
fs/btrfs/ctree.c:431:6: note: Assuming the condition is false
if (root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/btrfs/ctree.c:431:2: note: Taking false branch
if (root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID)
^
fs/btrfs/ctree.c:439:6: note: Assuming 'ret' is 0
if (ret) {
^~~
fs/btrfs/ctree.c:439:2: note: Taking false branch
if (ret) {
^
fs/btrfs/ctree.c:446:6: note: Assuming the condition is false
if (test_bit(BTRFS_ROOT_SHAREABLE, &root->state)) {
^
include/asm-generic/bitops/non-atomic.h:120:18: note: expanded from macro 'test_bit'
#define test_bit arch_test_bit
^
fs/btrfs/ctree.c:446:2: note: Taking false branch
if (test_bit(BTRFS_ROOT_SHAREABLE, &root->state)) {
^
fs/btrfs/ctree.c:456:6: note: Assuming 'buf' is not equal to field 'node'
if (buf == root->node) {
^~~~~~~~~~~~~~~~~
fs/btrfs/ctree.c:456:2: note: Taking false branch
if (buf == root->node) {
^
fs/btrfs/ctree.c:472:53: note: Passing null pointer value via 1st parameter 'eb'
WARN_ON(trans->transid != btrfs_header_generation(parent));
^
include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
int __ret_warn_on = !!(condition); \
^~~~~~~~~
fs/btrfs/ctree.c:472:29: note: Calling 'btrfs_header_generation'
WARN_ON(trans->transid != btrfs_header_generation(parent));
^
include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
int __ret_warn_on = !!(condition); \
^~~~~~~~~
fs/btrfs/ctree.h:2215:1: note: Array access (via field 'pages') results in a null pointer dereference
BTRFS_SETGET_HEADER_FUNCS(header_generation, struct btrfs_header,
^
fs/btrfs/ctree.h:1667:31: note: expanded from macro 'BTRFS_SETGET_HEADER_FUNCS'
const type *p = page_address(eb->pages[0]) + \
^ ~~~~~
Suppressed 59 warnings (59 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.
52 warnings generated.
drivers/iommu/of_iommu.c:202:3: warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(&res, 0, sizeof(res));
^
include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'
#define memset(p, c, s) __fortify_memset_chk(p, c, s, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:265:2: note: expanded from macro '__fortify_memset_chk'
__underlying_memset(p, c, __fortify_size); \
^~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:47:29: note: expanded from macro '__underlying_memset'
#define __underlying_memset __builtin_memset
^~~~~~~~~~~~~~~~
drivers/iommu/of_iommu.c:202:3: note: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
memset(&res, 0, sizeof(res));
^
include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'
#define memset(p, c, s) __fortify_memset_chk(p, c, s, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:265:2: note: expanded from macro '__fortify_memset_chk'
__underlying_memset(p, c, __fortify_size); \
^~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:47:29: note: expanded from macro '__underlying_memset'
#define __underlying_memset __builtin_memset
^~~~~~~~~~~~~~~~
>> drivers/iommu/of_iommu.c:237:5: warning: Value stored to 'end' is never read [clang-analyzer-deadcode.DeadStores]
end = start + length - 1;
^ ~~~~~~~~~~~~~~~~~~
drivers/iommu/of_iommu.c:237:5: note: Value stored to 'end' is never read
end = start + length - 1;
^ ~~~~~~~~~~~~~~~~~~
Suppressed 50 warnings (48 in non-user code, 2 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
55 warnings generated.
Suppressed 55 warnings (55 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.
48 warnings generated.
Suppressed 48 warnings (48 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.
48 warnings generated.
Suppressed 48 warnings (48 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.
48 warnings generated.
Suppressed 48 warnings (48 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.
62 warnings generated.
drivers/char/virtio_console.c:682:3: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy((__force char *)out_buf, buf->buf + buf->offset,
^
include/linux/fortify-string.h:369:26: note: expanded from macro 'memcpy'
#define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:362:2: note: expanded from macro '__fortify_memcpy_chk'
__underlying_##op(p, q, __fortify_size); \
^~~~~~~~~~~~~~~~~
note: expanded from here
include/linux/fortify-string.h:45:29: note: expanded from macro '__underlying_memcpy'
#define __underlying_memcpy __builtin_memcpy
^~~~~~~~~~~~~~~~
drivers/char/virtio_console.c:682:3: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11
memcpy((__force char *)out_buf, buf->buf + buf->offset,
^
include/linux/fortify-string.h:369:26: note: expanded from macro 'memcpy'
#define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:362:2: note: expanded from macro '__fortify_memcpy_chk'
__underlying_##op(p, q, __fortify_size); \
^~~~~~~~~~~~~~~~~
note: expanded from here
include/linux/fortify-string.h:45:29: note: expanded from macro '__underlying_memcpy'
#define __underlying_memcpy __builtin_memcpy
^~~~~~~~~~~~~~~~
drivers/char/virtio_console.c:897:3: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(page_address(page) + offset, src + buf->offset, len);
^
include/linux/fortify-string.h:369:26: note: expanded from macro 'memcpy'
#define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:362:2: note: expanded from macro '__fortify_memcpy_chk'
__underlying_##op(p, q, __fortify_size); \
^~~~~~~~~~~~~~~~~
note: expanded from here
include/linux/fortify-string.h:45:29: note: expanded from macro '__underlying_memcpy'
#define __underlying_memcpy __builtin_memcpy
^~~~~~~~~~~~~~~~
drivers/char/virtio_console.c:897:3: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11
memcpy(page_address(page) + offset, src + buf->offset, len);
^
include/linux/fortify-string.h:369:26: note: expanded from macro 'memcpy'
#define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:362:2: note: expanded from macro '__fortify_memcpy_chk'
__underlying_##op(p, q, __fortify_size); \
^~~~~~~~~~~~~~~~~
note: expanded from here
include/linux/fortify-string.h:45:29: note: expanded from macro '__underlying_memcpy'
#define __underlying_memcpy __builtin_memcpy
^~~~~~~~~~~~~~~~
drivers/char/virtio_console.c:1283:9: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
return sprintf(buffer, "%s\n", port->name);
^~~~~~~
drivers/char/virtio_console.c:1283:9: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11
return sprintf(buffer, "%s\n", port->name);
^~~~~~~
drivers/char/virtio_console.c:1464:2: warning: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
snprintf(debugfs_name, sizeof(debugfs_name), "vport%up%u",
^~~~~~~~
drivers/char/virtio_console.c:1464:2: note: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11
snprintf(debugfs_name, sizeof(debugfs_name), "vport%up%u",
^~~~~~~~
drivers/char/virtio_console.c:1625:3: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(&size, buf->buf + buf->offset + sizeof(*cpkt),
^
include/linux/fortify-string.h:369:26: note: expanded from macro 'memcpy'
#define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:362:2: note: expanded from macro '__fortify_memcpy_chk'
__underlying_##op(p, q, __fortify_size); \
^~~~~~~~~~~~~~~~~
note: expanded from here
include/linux/fortify-string.h:45:29: note: expanded from macro '__underlying_memcpy'
#define __underlying_memcpy __builtin_memcpy
^~~~~~~~~~~~~~~~
drivers/char/virtio_console.c:1625:3: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11
memcpy(&size, buf->buf + buf->offset + sizeof(*cpkt),
^
vim +/end +237 drivers/iommu/of_iommu.c
66e3b4ba9a4d92 Thierry Reding 2019-08-20 178
66e3b4ba9a4d92 Thierry Reding 2019-08-20 179 /**
66e3b4ba9a4d92 Thierry Reding 2019-08-20 180 * of_iommu_get_resv_regions - reserved region driver helper for device tree
66e3b4ba9a4d92 Thierry Reding 2019-08-20 181 * @dev: device for which to get reserved regions
66e3b4ba9a4d92 Thierry Reding 2019-08-20 182 * @list: reserved region list
66e3b4ba9a4d92 Thierry Reding 2019-08-20 183 *
66e3b4ba9a4d92 Thierry Reding 2019-08-20 184 * IOMMU drivers can use this to implement their .get_resv_regions() callback
66e3b4ba9a4d92 Thierry Reding 2019-08-20 185 * for memory regions attached to a device tree node. See the reserved-memory
66e3b4ba9a4d92 Thierry Reding 2019-08-20 186 * device tree bindings on how to use these:
66e3b4ba9a4d92 Thierry Reding 2019-08-20 187 *
66e3b4ba9a4d92 Thierry Reding 2019-08-20 188 * Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
66e3b4ba9a4d92 Thierry Reding 2019-08-20 189 */
66e3b4ba9a4d92 Thierry Reding 2019-08-20 190 void of_iommu_get_resv_regions(struct device *dev, struct list_head *list)
66e3b4ba9a4d92 Thierry Reding 2019-08-20 191 {
66e3b4ba9a4d92 Thierry Reding 2019-08-20 192 #if IS_ENABLED(CONFIG_OF_ADDRESS)
66e3b4ba9a4d92 Thierry Reding 2019-08-20 193 struct of_phandle_iterator it;
66e3b4ba9a4d92 Thierry Reding 2019-08-20 194 int err;
66e3b4ba9a4d92 Thierry Reding 2019-08-20 195
a39ec325554470 Thierry Reding 2022-04-25 196 of_for_each_phandle(&it, err, dev->of_node, "memory-region", NULL, 0) {
66e3b4ba9a4d92 Thierry Reding 2019-08-20 197 struct iommu_resv_region *region;
66e3b4ba9a4d92 Thierry Reding 2019-08-20 198 struct resource res;
a39ec325554470 Thierry Reding 2022-04-25 199 const __be32 *maps;
a39ec325554470 Thierry Reding 2022-04-25 200 int size;
66e3b4ba9a4d92 Thierry Reding 2019-08-20 201
a39ec325554470 Thierry Reding 2022-04-25 202 memset(&res, 0, sizeof(res));
66e3b4ba9a4d92 Thierry Reding 2019-08-20 203
a39ec325554470 Thierry Reding 2022-04-25 204 /*
a39ec325554470 Thierry Reding 2022-04-25 205 * The "reg" property is optional and can be omitted by reserved-memory regions
a39ec325554470 Thierry Reding 2022-04-25 206 * that represent reservations in the IOVA space, which are regions that should
a39ec325554470 Thierry Reding 2022-04-25 207 * not be mapped.
a39ec325554470 Thierry Reding 2022-04-25 208 */
a39ec325554470 Thierry Reding 2022-04-25 209 if (of_find_property(it.node, "reg", NULL)) {
66e3b4ba9a4d92 Thierry Reding 2019-08-20 210 err = of_address_to_resource(it.node, 0, &res);
66e3b4ba9a4d92 Thierry Reding 2019-08-20 211 if (err < 0) {
66e3b4ba9a4d92 Thierry Reding 2019-08-20 212 dev_err(dev, "failed to parse memory region %pOF: %d\n",
66e3b4ba9a4d92 Thierry Reding 2019-08-20 213 it.node, err);
66e3b4ba9a4d92 Thierry Reding 2019-08-20 214 continue;
66e3b4ba9a4d92 Thierry Reding 2019-08-20 215 }
a39ec325554470 Thierry Reding 2022-04-25 216 }
a39ec325554470 Thierry Reding 2022-04-25 217
a39ec325554470 Thierry Reding 2022-04-25 218 maps = of_get_property(it.node, "iommu-addresses", &size);
a39ec325554470 Thierry Reding 2022-04-25 219 if (maps) {
a39ec325554470 Thierry Reding 2022-04-25 220 const __be32 *end = maps + size / sizeof(__be32);
a39ec325554470 Thierry Reding 2022-04-25 221 struct device_node *np;
a39ec325554470 Thierry Reding 2022-04-25 222 unsigned int index = 0;
a39ec325554470 Thierry Reding 2022-04-25 223 u32 phandle;
a39ec325554470 Thierry Reding 2022-04-25 224 int na, ns;
a39ec325554470 Thierry Reding 2022-04-25 225
a39ec325554470 Thierry Reding 2022-04-25 226 while (maps < end) {
a39ec325554470 Thierry Reding 2022-04-25 227 phys_addr_t start, end;
a39ec325554470 Thierry Reding 2022-04-25 228 size_t length;
a39ec325554470 Thierry Reding 2022-04-25 229
a39ec325554470 Thierry Reding 2022-04-25 230 phandle = be32_to_cpup(maps++);
a39ec325554470 Thierry Reding 2022-04-25 231 np = of_find_node_by_phandle(phandle);
a39ec325554470 Thierry Reding 2022-04-25 232 na = of_n_addr_cells(np);
a39ec325554470 Thierry Reding 2022-04-25 233 ns = of_n_size_cells(np);
a39ec325554470 Thierry Reding 2022-04-25 234
a39ec325554470 Thierry Reding 2022-04-25 235 start = of_translate_dma_address(np, maps);
a39ec325554470 Thierry Reding 2022-04-25 236 length = of_read_number(maps + na, ns);
a39ec325554470 Thierry Reding 2022-04-25 @237 end = start + length - 1;
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months, 2 weeks
[bvanassche:ufs-for-next 5/6] drivers/ufs/core/ufshpb.c:1538 ufshpb_init_subregion_tbl() error: potentially dereferencing uninitialized 'srgn'.
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Bart Van Assche <bvanassche(a)acm.org>
Hi Bart,
First bad commit (maybe != root cause):
tree: https://github.com/bvanassche/linux ufs-for-next
head: d34bcd2acd8e932a32bf1aac6296ee8ea8d230d3
commit: c7ae521dbba0e69015cf50f474d58778326931d3 [5/6] scsi: ufs: Split the drivers/scsi/ufs directory
:::::: branch date: 15 hours ago
:::::: commit date: 15 hours ago
config: nios2-randconfig-m031-20220428 (https://download.01.org/0day-ci/archive/20220429/202204291937.TmnRM37F-lk...)
compiler: nios2-linux-gcc (GCC) 11.3.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/ufs/core/ufshpb.c:1538 ufshpb_init_subregion_tbl() error: potentially dereferencing uninitialized 'srgn'.
vim +/srgn +1538 drivers/ufs/core/ufshpb.c
4b5f49079c52a7e drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1522
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1523 static void ufshpb_init_subregion_tbl(struct ufshpb_lu *hpb,
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1524 struct ufshpb_region *rgn, bool last)
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1525 {
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1526 int srgn_idx;
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1527 struct ufshpb_subregion *srgn;
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1528
4b5f49079c52a7e drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1529 for_each_sub_region(rgn, srgn_idx, srgn) {
4b5f49079c52a7e drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1530 INIT_LIST_HEAD(&srgn->list_act_srgn);
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1531
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1532 srgn->rgn_idx = rgn->rgn_idx;
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1533 srgn->srgn_idx = srgn_idx;
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1534 srgn->srgn_state = HPB_SRGN_UNUSED;
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1535 }
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1536
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1537 if (unlikely(last && hpb->last_srgn_entries))
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 @1538 srgn->is_last = true;
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1539 }
f02bc9754a6887b drivers/scsi/ufs/ufshpb.c Daejun Park 2021-07-12 1540
:::::: The code at line 1538 was first introduced by commit
:::::: f02bc9754a6887bf5e286889265d24ce5e3b1952 scsi: ufs: ufshpb: Introduce Host Performance Buffer feature
:::::: TO: Daejun Park <daejun7.park(a)samsung.com>
:::::: CC: Martin K. Petersen <martin.petersen(a)oracle.com>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months, 2 weeks