[hnaz-mm:master 292/410] mm/mmap.c:795 __vma_adjust() error: we previously assumed 'next' could be null (see line 786)
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: dce94fc7a40fd9b59cb5c56b933b45b978ca85c3 [292/410] mmap: change zeroing of maple tree in __vma_adjust()
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: x86_64-randconfig-m001-20220425 (https://download.01.org/0day-ci/archive/20220501/202205010525.4JNDec1E-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:795 __vma_adjust() error: we previously assumed 'next' could be null (see line 786)
vim +/next +795 mm/mmap.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 608
^1da177e4c3f41 Linus Torvalds 2005-04-16 609 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 610 * We cannot adjust vm_start, vm_end, vm_pgoff fields of a vma that
^1da177e4c3f41 Linus Torvalds 2005-04-16 611 * is already present in an i_mmap tree without adjusting the tree.
^1da177e4c3f41 Linus Torvalds 2005-04-16 612 * The following helper function should be used when such adjustments
^1da177e4c3f41 Linus Torvalds 2005-04-16 613 * are necessary. The "insert" vma (if any) is to be inserted
^1da177e4c3f41 Linus Torvalds 2005-04-16 614 * before we drop the necessary locks.
^1da177e4c3f41 Linus Torvalds 2005-04-16 615 */
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 616 int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 617 unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert,
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 618 struct vm_area_struct *expand)
^1da177e4c3f41 Linus Torvalds 2005-04-16 619 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 620 struct mm_struct *mm = vma->vm_mm;
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 621 struct vm_area_struct *next_next, *next = find_vma(mm, vma->vm_end);
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 622 struct vm_area_struct *orig_vma = vma;
^1da177e4c3f41 Linus Torvalds 2005-04-16 623 struct address_space *mapping = NULL;
f808c13fd37389 Davidlohr Bueso 2017-09-08 624 struct rb_root_cached *root = NULL;
012f18004da33b Rik van Riel 2010-08-09 625 struct anon_vma *anon_vma = NULL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 626 struct file *file = vma->vm_file;
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 627 bool vma_changed = false;
^1da177e4c3f41 Linus Torvalds 2005-04-16 628 long adjust_next = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 629 int remove_next = 0;
f90a08f5f1a502 Liam R. Howlett 2022-04-26 630 MA_STATE(mas, &mm->mm_mt, 0, 0);
734537c9cb725f Kirill A. Shutemov 2016-07-28 631 struct vm_area_struct *exporter = NULL, *importer = NULL;
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 632 unsigned long ll_prev = vma->vm_start; /* linked list prev. */
287d97ac032136 Linus Torvalds 2010-04-10 633
f90a08f5f1a502 Liam R. Howlett 2022-04-26 634 if (next && !insert) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 635 if (end >= next->vm_end) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 636 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 637 * vma expands, overlapping all the next, and
^1da177e4c3f41 Linus Torvalds 2005-04-16 638 * perhaps the one after too (mprotect case 6).
86d12e471d9f15 Andrea Arcangeli 2016-10-07 639 * The only other cases that gets here are
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 640 * case 1, case 7 and case 8.
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 641 */
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 642 if (next == expand) {
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 643 /*
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 644 * The only case where we don't expand "vma"
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 645 * and we expand "next" instead is case 8.
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 646 */
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 647 VM_WARN_ON(end != next->vm_end);
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 648 /*
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 649 * remove_next == 3 means we're
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 650 * removing "vma" and that to do so we
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 651 * swapped "vma" and "next".
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 652 */
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 653 remove_next = 3;
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 654 VM_WARN_ON(file != next->vm_file);
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 655 swap(vma, next);
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 656 } else {
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 657 VM_WARN_ON(expand != vma);
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 658 /*
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 659 * case 1, 6, 7, remove_next == 2 is case 6,
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 660 * remove_next == 1 is case 1 or 7.
^1da177e4c3f41 Linus Torvalds 2005-04-16 661 */
734537c9cb725f Kirill A. Shutemov 2016-07-28 662 remove_next = 1 + (end > next->vm_end);
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 663 next_next = find_vma(mm, next->vm_end);
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 664 VM_WARN_ON(remove_next == 2 &&
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 665 end != next_next->vm_end);
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 666 /* trim end to next, for case 6 first pass */
^1da177e4c3f41 Linus Torvalds 2005-04-16 667 end = next->vm_end;
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 668 }
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 669
287d97ac032136 Linus Torvalds 2010-04-10 670 exporter = next;
^1da177e4c3f41 Linus Torvalds 2005-04-16 671 importer = vma;
734537c9cb725f Kirill A. Shutemov 2016-07-28 672
734537c9cb725f Kirill A. Shutemov 2016-07-28 673 /*
734537c9cb725f Kirill A. Shutemov 2016-07-28 674 * If next doesn't have anon_vma, import from vma after
734537c9cb725f Kirill A. Shutemov 2016-07-28 675 * next, if the vma overlaps with it.
734537c9cb725f Kirill A. Shutemov 2016-07-28 676 */
97a42cd4398162 Andrea Arcangeli 2016-10-07 677 if (remove_next == 2 && !next->anon_vma)
734537c9cb725f Kirill A. Shutemov 2016-07-28 678 exporter = next->vm_next;
734537c9cb725f Kirill A. Shutemov 2016-07-28 679
^1da177e4c3f41 Linus Torvalds 2005-04-16 680 } else if (end > next->vm_start) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 681 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 682 * vma expands, overlapping part of the next:
^1da177e4c3f41 Linus Torvalds 2005-04-16 683 * mprotect case 5 shifting the boundary up.
^1da177e4c3f41 Linus Torvalds 2005-04-16 684 */
f9d86a60572295 Wei Yang 2020-10-13 685 adjust_next = (end - next->vm_start);
287d97ac032136 Linus Torvalds 2010-04-10 686 exporter = next;
^1da177e4c3f41 Linus Torvalds 2005-04-16 687 importer = vma;
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 688 VM_WARN_ON(expand != importer);
^1da177e4c3f41 Linus Torvalds 2005-04-16 689 } else if (end < vma->vm_end) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 690 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 691 * vma shrinks, and !insert tells it's not
^1da177e4c3f41 Linus Torvalds 2005-04-16 692 * split_vma inserting another: so it must be
^1da177e4c3f41 Linus Torvalds 2005-04-16 693 * mprotect case 4 shifting the boundary down.
^1da177e4c3f41 Linus Torvalds 2005-04-16 694 */
f9d86a60572295 Wei Yang 2020-10-13 695 adjust_next = -(vma->vm_end - end);
287d97ac032136 Linus Torvalds 2010-04-10 696 exporter = vma;
^1da177e4c3f41 Linus Torvalds 2005-04-16 697 importer = next;
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 698 VM_WARN_ON(expand != importer);
^1da177e4c3f41 Linus Torvalds 2005-04-16 699 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 700
5beb49305251e5 Rik van Riel 2010-03-05 701 /*
5beb49305251e5 Rik van Riel 2010-03-05 702 * Easily overlooked: when mprotect shifts the boundary,
5beb49305251e5 Rik van Riel 2010-03-05 703 * make sure the expanding vma has anon_vma set if the
5beb49305251e5 Rik van Riel 2010-03-05 704 * shrinking vma had, to cover any anon pages imported.
5beb49305251e5 Rik van Riel 2010-03-05 705 */
287d97ac032136 Linus Torvalds 2010-04-10 706 if (exporter && exporter->anon_vma && !importer->anon_vma) {
c4ea95d7cd08d9 Daniel Forrest 2014-12-02 707 int error;
c4ea95d7cd08d9 Daniel Forrest 2014-12-02 708
b800c91a051707 Konstantin Khlebnikov 2015-01-11 709 importer->anon_vma = exporter->anon_vma;
c4ea95d7cd08d9 Daniel Forrest 2014-12-02 710 error = anon_vma_clone(importer, exporter);
3fe89b3e2a7bbf Leon Yu 2015-03-25 711 if (error)
c4ea95d7cd08d9 Daniel Forrest 2014-12-02 712 return error;
b800c91a051707 Konstantin Khlebnikov 2015-01-11 713 }
5beb49305251e5 Rik van Riel 2010-03-05 714 }
734537c9cb725f Kirill A. Shutemov 2016-07-28 715 again:
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 716 vma_adjust_trans_huge(orig_vma, start, end, adjust_next);
37f9f5595c26d3 Kirill A. Shutemov 2016-07-26 717
f90a08f5f1a502 Liam R. Howlett 2022-04-26 718 if (mas_preallocate(&mas, vma, GFP_KERNEL)) {
f90a08f5f1a502 Liam R. Howlett 2022-04-26 719 if (exporter && exporter->anon_vma)
f90a08f5f1a502 Liam R. Howlett 2022-04-26 720 unlink_anon_vmas(importer);
f90a08f5f1a502 Liam R. Howlett 2022-04-26 721 return -ENOMEM;
f90a08f5f1a502 Liam R. Howlett 2022-04-26 722 }
f90a08f5f1a502 Liam R. Howlett 2022-04-26 723
^1da177e4c3f41 Linus Torvalds 2005-04-16 724 if (file) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 725 mapping = file->f_mapping;
^1da177e4c3f41 Linus Torvalds 2005-04-16 726 root = &mapping->i_mmap;
cbc91f71b51b83 Srikar Dronamraju 2012-04-11 727 uprobe_munmap(vma, vma->vm_start, vma->vm_end);
682968e0c425c6 Srikar Dronamraju 2012-03-30 728
682968e0c425c6 Srikar Dronamraju 2012-03-30 729 if (adjust_next)
27ba0644ea9dfe Kirill A. Shutemov 2015-02-10 730 uprobe_munmap(next, next->vm_start, next->vm_end);
682968e0c425c6 Srikar Dronamraju 2012-03-30 731
83cde9e8ba95d1 Davidlohr Bueso 2014-12-12 732 i_mmap_lock_write(mapping);
^1da177e4c3f41 Linus Torvalds 2005-04-16 733 if (insert) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 734 /*
6b2dbba8b6ac4d Michel Lespinasse 2012-10-08 735 * Put into interval tree now, so instantiated pages
^1da177e4c3f41 Linus Torvalds 2005-04-16 736 * are visible to arm/parisc __flush_dcache_page
^1da177e4c3f41 Linus Torvalds 2005-04-16 737 * throughout; but we cannot insert into address
^1da177e4c3f41 Linus Torvalds 2005-04-16 738 * space until vma start or end is updated.
^1da177e4c3f41 Linus Torvalds 2005-04-16 739 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 740 __vma_link_file(insert);
^1da177e4c3f41 Linus Torvalds 2005-04-16 741 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 742 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 743
012f18004da33b Rik van Riel 2010-08-09 744 anon_vma = vma->anon_vma;
bf181b9f9d8dfb Michel Lespinasse 2012-10-08 745 if (!anon_vma && adjust_next)
bf181b9f9d8dfb Michel Lespinasse 2012-10-08 746 anon_vma = next->anon_vma;
bf181b9f9d8dfb Michel Lespinasse 2012-10-08 747 if (anon_vma) {
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 748 VM_WARN_ON(adjust_next && next->anon_vma &&
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 749 anon_vma != next->anon_vma);
4fc3f1d66b1ef0 Ingo Molnar 2012-12-02 750 anon_vma_lock_write(anon_vma);
bf181b9f9d8dfb Michel Lespinasse 2012-10-08 751 anon_vma_interval_tree_pre_update_vma(vma);
bf181b9f9d8dfb Michel Lespinasse 2012-10-08 752 if (adjust_next)
bf181b9f9d8dfb Michel Lespinasse 2012-10-08 753 anon_vma_interval_tree_pre_update_vma(next);
bf181b9f9d8dfb Michel Lespinasse 2012-10-08 754 }
012f18004da33b Rik van Riel 2010-08-09 755
0fc48a6e213ab8 Wei Yang 2020-10-13 756 if (file) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 757 flush_dcache_mmap_lock(mapping);
6b2dbba8b6ac4d Michel Lespinasse 2012-10-08 758 vma_interval_tree_remove(vma, root);
^1da177e4c3f41 Linus Torvalds 2005-04-16 759 if (adjust_next)
6b2dbba8b6ac4d Michel Lespinasse 2012-10-08 760 vma_interval_tree_remove(next, root);
^1da177e4c3f41 Linus Torvalds 2005-04-16 761 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 762
d37371870ceb1d Michel Lespinasse 2012-12-11 763 if (start != vma->vm_start) {
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 764 if ((vma->vm_start < start) &&
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 765 (!insert || (insert->vm_end != start))) {
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 766 vma_mt_szero(mm, vma->vm_start, start);
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 767 VM_WARN_ON(insert && insert->vm_start > vma->vm_start);
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 768 } else {
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 769 vma_changed = true;
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 770 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 771 vma->vm_start = start;
d37371870ceb1d Michel Lespinasse 2012-12-11 772 }
d37371870ceb1d Michel Lespinasse 2012-12-11 773 if (end != vma->vm_end) {
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 774 if (vma->vm_end > end) {
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 775 if (!insert || (insert->vm_start != end)) {
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 776 vma_mt_szero(mm, end, vma->vm_end);
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 777 VM_WARN_ON(insert &&
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 778 insert->vm_end < vma->vm_end);
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 779 } else if (insert->vm_start == end) {
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 780 ll_prev = vma->vm_end;
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 781 }
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 782 } else {
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 783 vma_changed = true;
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 784 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 785 vma->vm_end = end;
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 @786 if (!next)
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 787 mm->highest_vm_end = vm_end_gap(vma);
d37371870ceb1d Michel Lespinasse 2012-12-11 788 }
f90a08f5f1a502 Liam R. Howlett 2022-04-26 789
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 790 if (vma_changed)
f90a08f5f1a502 Liam R. Howlett 2022-04-26 791 vma_mas_store(vma, &mas);
f90a08f5f1a502 Liam R. Howlett 2022-04-26 792
^1da177e4c3f41 Linus Torvalds 2005-04-16 793 vma->vm_pgoff = pgoff;
^1da177e4c3f41 Linus Torvalds 2005-04-16 794 if (adjust_next) {
f9d86a60572295 Wei Yang 2020-10-13 @795 next->vm_start += adjust_next;
f9d86a60572295 Wei Yang 2020-10-13 796 next->vm_pgoff += adjust_next >> PAGE_SHIFT;
f90a08f5f1a502 Liam R. Howlett 2022-04-26 797 vma_mas_store(next, &mas);
^1da177e4c3f41 Linus Torvalds 2005-04-16 798 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 799
0fc48a6e213ab8 Wei Yang 2020-10-13 800 if (file) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 801 if (adjust_next)
6b2dbba8b6ac4d Michel Lespinasse 2012-10-08 802 vma_interval_tree_insert(next, root);
6b2dbba8b6ac4d Michel Lespinasse 2012-10-08 803 vma_interval_tree_insert(vma, root);
^1da177e4c3f41 Linus Torvalds 2005-04-16 804 flush_dcache_mmap_unlock(mapping);
^1da177e4c3f41 Linus Torvalds 2005-04-16 805 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 806
^1da177e4c3f41 Linus Torvalds 2005-04-16 807 if (remove_next) {
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 808 __vma_unlink_list(mm, next);
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 809 /* Kill the cache */
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 810 vmacache_invalidate(mm);
^1da177e4c3f41 Linus Torvalds 2005-04-16 811 if (file)
^1da177e4c3f41 Linus Torvalds 2005-04-16 812 __remove_shared_vm_struct(next, file, mapping);
^1da177e4c3f41 Linus Torvalds 2005-04-16 813 } else if (insert) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 814 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 815 * split_vma has split insert from vma, and needs
^1da177e4c3f41 Linus Torvalds 2005-04-16 816 * us to insert it before dropping the locks
^1da177e4c3f41 Linus Torvalds 2005-04-16 817 * (it may either follow vma or precede it).
^1da177e4c3f41 Linus Torvalds 2005-04-16 818 */
dce94fc7a40fd9 Liam R. Howlett 2022-04-26 819 __insert_vm_struct(mm, &mas, insert, ll_prev);
^1da177e4c3f41 Linus Torvalds 2005-04-16 820 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 821
bf181b9f9d8dfb Michel Lespinasse 2012-10-08 822 if (anon_vma) {
bf181b9f9d8dfb Michel Lespinasse 2012-10-08 823 anon_vma_interval_tree_post_update_vma(vma);
bf181b9f9d8dfb Michel Lespinasse 2012-10-08 824 if (adjust_next)
bf181b9f9d8dfb Michel Lespinasse 2012-10-08 825 anon_vma_interval_tree_post_update_vma(next);
08b52706d50565 Konstantin Khlebnikov 2013-02-22 826 anon_vma_unlock_write(anon_vma);
bf181b9f9d8dfb Michel Lespinasse 2012-10-08 827 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 828
0fc48a6e213ab8 Wei Yang 2020-10-13 829 if (file) {
808fbdbea05f1e Wei Yang 2020-10-13 830 i_mmap_unlock_write(mapping);
7b2d81d48a2d8e Ingo Molnar 2012-02-17 831 uprobe_mmap(vma);
2b144498350860 Srikar Dronamraju 2012-02-09 832
2b144498350860 Srikar Dronamraju 2012-02-09 833 if (adjust_next)
7b2d81d48a2d8e Ingo Molnar 2012-02-17 834 uprobe_mmap(next);
2b144498350860 Srikar Dronamraju 2012-02-09 835 }
2b144498350860 Srikar Dronamraju 2012-02-09 836
^1da177e4c3f41 Linus Torvalds 2005-04-16 837 if (remove_next) {
925d1c401fa6cf Matt Helsley 2008-04-29 838 if (file) {
cbc91f71b51b83 Srikar Dronamraju 2012-04-11 839 uprobe_munmap(next, next->vm_start, next->vm_end);
^1da177e4c3f41 Linus Torvalds 2005-04-16 840 fput(file);
925d1c401fa6cf Matt Helsley 2008-04-29 841 }
5beb49305251e5 Rik van Riel 2010-03-05 842 if (next->anon_vma)
5beb49305251e5 Rik van Riel 2010-03-05 843 anon_vma_merge(vma, next);
^1da177e4c3f41 Linus Torvalds 2005-04-16 844 mm->map_count--;
3964acd0dbec12 Oleg Nesterov 2013-07-31 845 mpol_put(vma_policy(next));
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 846 BUG_ON(vma->vm_end < next->vm_end);
3928d4f5ee37cd Linus Torvalds 2018-07-21 847 vm_area_free(next);
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 848
^1da177e4c3f41 Linus Torvalds 2005-04-16 849 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 850 * In mprotect's case 6 (see comments on vma_merge),
^1da177e4c3f41 Linus Torvalds 2005-04-16 851 * we must remove another next too. It would clutter
^1da177e4c3f41 Linus Torvalds 2005-04-16 852 * up the code too much to do both in one go.
^1da177e4c3f41 Linus Torvalds 2005-04-16 853 */
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 854 if (remove_next != 3) {
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 855 /*
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 856 * If "next" was removed and vma->vm_end was
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 857 * expanded (up) over it, in turn
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 858 * "next->vm_prev->vm_end" changed and the
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 859 * "vma->vm_next" gap must be updated.
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 860 */
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 861 next = next_next;
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 862 } else {
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 863 /*
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 864 * For the scope of the comment "next" and
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 865 * "vma" considered pre-swap(): if "vma" was
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 866 * removed, next->vm_start was expanded (down)
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 867 * over it and the "next" gap must be updated.
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 868 * Because of the swap() the post-swap() "vma"
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 869 * actually points to pre-swap() "next"
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 870 * (post-swap() "next" as opposed is now a
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 871 * dangling pointer).
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 872 */
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 873 next = vma;
e86f15ee64d8ee Andrea Arcangeli 2016-10-07 874 }
734537c9cb725f Kirill A. Shutemov 2016-07-28 875 if (remove_next == 2) {
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 876 mas_reset(&mas);
734537c9cb725f Kirill A. Shutemov 2016-07-28 877 remove_next = 1;
734537c9cb725f Kirill A. Shutemov 2016-07-28 878 end = next->vm_end;
^1da177e4c3f41 Linus Torvalds 2005-04-16 879 goto again;
48c8a6f751a2c8 Liam R. Howlett 2022-04-26 880 } else if (!next) {
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 881 /*
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 882 * If remove_next == 2 we obviously can't
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 883 * reach this path.
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 884 *
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 885 * If remove_next == 3 we can't reach this
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 886 * path because pre-swap() next is always not
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 887 * NULL. pre-swap() "next" is not being
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 888 * removed and its next->vm_end is not altered
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 889 * (and furthermore "end" already matches
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 890 * next->vm_end in remove_next == 3).
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 891 *
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 892 * We reach this only in the remove_next == 1
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 893 * case if the "next" vma that was removed was
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 894 * the highest vma of the mm. However in such
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 895 * case next->vm_end == "end" and the extended
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 896 * "vma" has vma->vm_end == next->vm_end so
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 897 * mm->highest_vm_end doesn't need any update
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 898 * in remove_next == 1 case.
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 899 */
1be7107fbe18ee Hugh Dickins 2017-06-19 900 VM_WARN_ON(mm->highest_vm_end != vm_end_gap(vma));
fb8c41e9ad1f35 Andrea Arcangeli 2016-10-07 901 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 902 }
2b144498350860 Srikar Dronamraju 2012-02-09 903 if (insert && file)
7b2d81d48a2d8e Ingo Molnar 2012-02-17 904 uprobe_mmap(insert);
^1da177e4c3f41 Linus Torvalds 2005-04-16 905
^1da177e4c3f41 Linus Torvalds 2005-04-16 906 validate_mm(mm);
5beb49305251e5 Rik van Riel 2010-03-05 907 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 908 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 909
:::::: The code at line 795 was first introduced by commit
:::::: f9d86a60572295ebb53c87a4305dc89b487711bd mm/mmap: leave adjust_next as virtual address instead of page frame number
:::::: TO: Wei Yang <richard.weiyang(a)linux.alibaba.com>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 months
drivers/gpio/gpio-tegra186.c:577:17: warning: Value stored to 'dev' during its initialization 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>
CC: Bartosz Golaszewski <brgl(a)bgdev.pl>
CC: Linus Walleij <linus.walleij(a)linaro.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 57ae8a492116910bad2b3497ffe555b3a4b4180f
commit: 2103868047456e5f3e431ebb253d87e1fb806c76 gpio: tegra186: Support multiple interrupts per bank
date: 7 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 7 months ago
config: riscv-randconfig-c006-20220427 (https://download.01.org/0day-ci/archive/20220501/202205010440.oCzWMMDp-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 1cddcfdc3c683b393df1a5c9063252eb60e52818)
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/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 2103868047456e5f3e431ebb253d87e1fb806c76
# save the config file
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 >>)
drivers/dma/sun6i-dma.c:601:18: note: '?' condition is false
drivers/dma/sun6i-dma.c:602:3: note: Execution continues on line 607
break;
^
drivers/dma/sun6i-dma.c:607:6: note: Assuming the condition is false
if (!(BIT(src_addr_width) & sdev->slave.src_addr_widths))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/sun6i-dma.c:607:2: note: Taking false branch
if (!(BIT(src_addr_width) & sdev->slave.src_addr_widths))
^
drivers/dma/sun6i-dma.c:609:6: note: Assuming the condition is false
if (!(BIT(dst_addr_width) & sdev->slave.dst_addr_widths))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/sun6i-dma.c:609:2: note: Taking false branch
if (!(BIT(dst_addr_width) & sdev->slave.dst_addr_widths))
^
drivers/dma/sun6i-dma.c:611:6: note: Assuming the condition is false
if (!(BIT(src_maxburst) & sdev->cfg->src_burst_lengths))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/sun6i-dma.c:611:2: note: Taking false branch
if (!(BIT(src_maxburst) & sdev->cfg->src_burst_lengths))
^
drivers/dma/sun6i-dma.c:613:6: note: Assuming the condition is false
if (!(BIT(dst_maxburst) & sdev->cfg->dst_burst_lengths))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/sun6i-dma.c:613:2: note: Taking false branch
if (!(BIT(dst_maxburst) & sdev->cfg->dst_burst_lengths))
^
drivers/dma/sun6i-dma.c:626:2: note: Returning zero, which participates in a condition later
return 0;
^~~~~~~~
drivers/dma/sun6i-dma.c:779:8: note: Returning from 'set_config'
ret = set_config(sdev, sconfig, dir, &lli_cfg);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/sun6i-dma.c:780:6: note: 'ret' is 0
if (ret) {
^~~
drivers/dma/sun6i-dma.c:780:2: note: Taking false branch
if (ret) {
^
drivers/dma/sun6i-dma.c:785:8: note: Calling 'kzalloc'
txd = kzalloc(sizeof(*txd), GFP_NOWAIT);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/slab.h:721:9: note: Calling 'kmalloc'
return kmalloc(size, flags | __GFP_ZERO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/slab.h:579:2: note: Taking false branch
if (__builtin_constant_p(size)) {
^
include/linux/slab.h:596:2: note: Returning pointer, which participates in a condition later
return __kmalloc(size, flags);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/slab.h:721:9: note: Returning from 'kmalloc'
return kmalloc(size, flags | __GFP_ZERO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/slab.h:721:2: note: Returning pointer, which participates in a condition later
return kmalloc(size, flags | __GFP_ZERO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/sun6i-dma.c:785:8: note: Returning from 'kzalloc'
txd = kzalloc(sizeof(*txd), GFP_NOWAIT);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/sun6i-dma.c:786:6: note: Assuming 'txd' is non-null
if (!txd)
^~~~
drivers/dma/sun6i-dma.c:786:2: note: Taking false branch
if (!txd)
^
drivers/dma/sun6i-dma.c:789:14: note: Assuming 'i' is >= 'periods'
for (i = 0; i < periods; i++) {
^~~~~~~~~~~
drivers/dma/sun6i-dma.c:789:2: note: Loop condition is false. Execution continues on line 816
for (i = 0; i < periods; i++) {
^
drivers/dma/sun6i-dma.c:816:19: note: Access to field 'p_lli_next' results in a dereference of a null pointer (loaded from variable 'prev')
prev->p_lli_next = txd->p_lli; /* cyclic list */
~~~~ ^
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.
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.
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.
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.
>> drivers/gpio/gpio-tegra186.c:577:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = gpio->gpio.parent;
^~~ ~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-tegra186.c:577:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = gpio->gpio.parent;
^~~ ~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-tegra186.c:616:6: warning: Value stored to 'value' is never read [clang-analyzer-deadcode.DeadStores]
value = readl(base + offset);
^
drivers/gpio/gpio-tegra186.c:616:6: note: Value stored to 'value' is never read
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.
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.
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.
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.
4 warnings generated.
drivers/regulator/bd9571mwv-regulator.c:91:6: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
val >>= ffs(rdev->desc->vsel_mask) - 1;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/regulator/bd9571mwv-regulator.c:83:6: note: Assuming 'ret' is >= 0
if (ret < 0)
^~~~~~~
drivers/regulator/bd9571mwv-regulator.c:83:2: note: Taking false branch
if (ret < 0)
^
drivers/regulator/bd9571mwv-regulator.c:87:6: note: Assuming 'ret' is equal to 0
if (ret != 0)
^~~~~~~~
drivers/regulator/bd9571mwv-regulator.c:87:2: note: Taking false branch
if (ret != 0)
^
drivers/regulator/bd9571mwv-regulator.c:91:6: note: Assigned value is garbage or undefined
val >>= ffs(rdev->desc->vsel_mask) - 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.
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.
7 warnings generated.
drivers/clk/clk-gemini.c:334:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
hw = clk_hw_register_fixed_factor(NULL, "secdiv", "ahb", 0, mult, div);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/clk-gemini.c:334:2: note: Value stored to 'hw' is never read
hw = clk_hw_register_fixed_factor(NULL, "secdiv", "ahb", 0, mult, div);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/clk-gemini.c:359:2: warning: Value stored to 'mult' is never read [clang-analyzer-deadcode.DeadStores]
mult = 1;
^ ~
drivers/clk/clk-gemini.c:359:2: note: Value stored to 'mult' is never read
mult = 1;
^ ~
drivers/clk/clk-gemini.c:362:2: warning: Value stored to 'div' is never read [clang-analyzer-deadcode.DeadStores]
div += 1;
^ ~
drivers/clk/clk-gemini.c:362:2: note: Value stored to 'div' is never read
div += 1;
^ ~
drivers/clk/clk-gemini.c:440:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
hw = clk_hw_register_fixed_rate(NULL, "xtal", NULL, 0, freq);
^
drivers/clk/clk-gemini.c:440:2: note: Value stored to 'hw' is never read
drivers/clk/clk-gemini.c:449:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
hw = clk_hw_register_fixed_factor(NULL, "vco", "xtal", 0, mult, div);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/dev +577 drivers/gpio/gpio-tegra186.c
5b2b135a87fcfb Thierry Reding 2017-11-07 574
22635ed8a20d47 Thierry Reding 2019-11-08 575 static void tegra186_gpio_init_route_mapping(struct tegra_gpio *gpio)
22635ed8a20d47 Thierry Reding 2019-11-08 576 {
2103868047456e Thierry Reding 2021-09-17 @577 struct device *dev = gpio->gpio.parent;
22635ed8a20d47 Thierry Reding 2019-11-08 578 unsigned int i, j;
22635ed8a20d47 Thierry Reding 2019-11-08 579 u32 value;
22635ed8a20d47 Thierry Reding 2019-11-08 580
22635ed8a20d47 Thierry Reding 2019-11-08 581 for (i = 0; i < gpio->soc->num_ports; i++) {
22635ed8a20d47 Thierry Reding 2019-11-08 582 const struct tegra_gpio_port *port = &gpio->soc->ports[i];
22635ed8a20d47 Thierry Reding 2019-11-08 583 unsigned int offset, p = port->port;
22635ed8a20d47 Thierry Reding 2019-11-08 584 void __iomem *base;
22635ed8a20d47 Thierry Reding 2019-11-08 585
22635ed8a20d47 Thierry Reding 2019-11-08 586 base = gpio->secure + port->bank * 0x1000 + 0x800;
22635ed8a20d47 Thierry Reding 2019-11-08 587
22635ed8a20d47 Thierry Reding 2019-11-08 588 value = readl(base + TEGRA186_GPIO_CTL_SCR);
22635ed8a20d47 Thierry Reding 2019-11-08 589
22635ed8a20d47 Thierry Reding 2019-11-08 590 /*
22635ed8a20d47 Thierry Reding 2019-11-08 591 * For controllers that haven't been locked down yet, make
22635ed8a20d47 Thierry Reding 2019-11-08 592 * sure to program the default interrupt route mapping.
22635ed8a20d47 Thierry Reding 2019-11-08 593 */
22635ed8a20d47 Thierry Reding 2019-11-08 594 if ((value & TEGRA186_GPIO_CTL_SCR_SEC_REN) == 0 &&
22635ed8a20d47 Thierry Reding 2019-11-08 595 (value & TEGRA186_GPIO_CTL_SCR_SEC_WEN) == 0) {
2103868047456e Thierry Reding 2021-09-17 596 /*
2103868047456e Thierry Reding 2021-09-17 597 * On Tegra194 and later, each pin can be routed to one or more
2103868047456e Thierry Reding 2021-09-17 598 * interrupts.
2103868047456e Thierry Reding 2021-09-17 599 */
2103868047456e Thierry Reding 2021-09-17 600 for (j = 0; j < gpio->num_irqs_per_bank; j++) {
2103868047456e Thierry Reding 2021-09-17 601 dev_dbg(dev, "programming default interrupt routing for port %s\n",
2103868047456e Thierry Reding 2021-09-17 602 port->name);
2103868047456e Thierry Reding 2021-09-17 603
22635ed8a20d47 Thierry Reding 2019-11-08 604 offset = TEGRA186_GPIO_INT_ROUTE_MAPPING(p, j);
22635ed8a20d47 Thierry Reding 2019-11-08 605
2103868047456e Thierry Reding 2021-09-17 606 /*
2103868047456e Thierry Reding 2021-09-17 607 * By default we only want to route GPIO pins to IRQ 0. This works
2103868047456e Thierry Reding 2021-09-17 608 * only under the assumption that we're running as the host kernel
2103868047456e Thierry Reding 2021-09-17 609 * and hence all GPIO pins are owned by Linux.
2103868047456e Thierry Reding 2021-09-17 610 *
2103868047456e Thierry Reding 2021-09-17 611 * For cases where Linux is the guest OS, the hypervisor will have
2103868047456e Thierry Reding 2021-09-17 612 * to configure the interrupt routing and pass only the valid
2103868047456e Thierry Reding 2021-09-17 613 * interrupts via device tree.
2103868047456e Thierry Reding 2021-09-17 614 */
2103868047456e Thierry Reding 2021-09-17 615 if (j == 0) {
22635ed8a20d47 Thierry Reding 2019-11-08 616 value = readl(base + offset);
22635ed8a20d47 Thierry Reding 2019-11-08 617 value = BIT(port->pins) - 1;
22635ed8a20d47 Thierry Reding 2019-11-08 618 writel(value, base + offset);
22635ed8a20d47 Thierry Reding 2019-11-08 619 }
22635ed8a20d47 Thierry Reding 2019-11-08 620 }
22635ed8a20d47 Thierry Reding 2019-11-08 621 }
22635ed8a20d47 Thierry Reding 2019-11-08 622 }
2103868047456e Thierry Reding 2021-09-17 623 }
22635ed8a20d47 Thierry Reding 2019-11-08 624
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 months
[hnaz-mm:master 280/410] lib/maple_tree.c:326:2: warning: Value stored to 'node' 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: "Liam R. Howlett" <Liam.Howlett(a)Oracle.com>
CC: Johannes Weiner <hannes(a)cmpxchg.org>
CC: "Matthew Wilcox (Oracle)" <willy(a)infradead.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: c11c433e3be4e5bef47f0a62a72064e18708e952 [280/410] Maple Tree: add new data structure
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: arm-randconfig-c002-20220429 (https://download.01.org/0day-ci/archive/20220501/202205010206.yC8yeSfw-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 400775649969b9baf3bc2a510266e7912bb16ae9)
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/hnaz/linux-mm/commit/c11c433e3be4e5bef47f0a62a72064e18...
git remote add hnaz-mm https://github.com/hnaz/linux-mm
git fetch --no-tags hnaz-mm master
git checkout c11c433e3be4e5bef47f0a62a72064e18708e952
# 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 >>)
49 warnings generated.
fs/erofs/data.c:269:20: warning: The left operand of '&' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
if (!(map.m_flags & EROFS_MAP_MAPPED)) {
~~~~~~~~~~~ ^
fs/erofs/data.c:248:8: note: Calling 'erofs_map_blocks'
ret = erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/erofs/data.c:126:2: note: Calling 'trace_erofs_map_blocks_enter'
trace_erofs_map_blocks_enter(inode, map, flags);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/trace/events/erofs.h:172:1: note: Returning without writing to 'map->m_flags'
DEFINE_EVENT(erofs__map_blocks_enter, erofs_map_blocks_enter,
^
include/linux/tracepoint.h:542:2: note: expanded from macro 'DEFINE_EVENT'
DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
^
include/linux/tracepoint.h:419:2: note: expanded from macro 'DECLARE_TRACE'
__DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \
^
include/linux/tracepoint.h:343:4: note: expanded from macro '__DECLARE_TRACE'
{ } \
^
fs/erofs/data.c:126:2: note: Returning from 'trace_erofs_map_blocks_enter'
trace_erofs_map_blocks_enter(inode, map, flags);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/erofs/data.c:128:6: note: Assuming field 'm_la' is < field 'i_size'
if (map->m_la >= inode->i_size) {
^~~~~~~~~~~~~~~~~~~~~~~~~~
fs/erofs/data.c:128:2: note: Taking false branch
if (map->m_la >= inode->i_size) {
^
fs/erofs/data.c:135:6: note: Assuming field 'datalayout' is equal to EROFS_INODE_CHUNK_BASED
if (vi->datalayout != EROFS_INODE_CHUNK_BASED) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/erofs/data.c:135:2: note: Taking false branch
if (vi->datalayout != EROFS_INODE_CHUNK_BASED) {
^
fs/erofs/data.c:140:6: note: Assuming the condition is false
if (vi->chunkformat & EROFS_CHUNK_FORMAT_INDEXES)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/erofs/data.c:140:2: note: Taking false branch
if (vi->chunkformat & EROFS_CHUNK_FORMAT_INDEXES)
^
fs/erofs/data.c:150:2: note: Taking true branch
if (IS_ERR(kaddr)) {
^
fs/erofs/data.c:152:3: note: Control jumps to line 186
goto out;
^
fs/erofs/data.c:186:7: note: 'err' is not equal to 0
if (!err)
^~~
fs/erofs/data.c:186:2: note: Taking false branch
if (!err)
^
fs/erofs/data.c:188:2: note: Calling 'trace_erofs_map_blocks_exit'
trace_erofs_map_blocks_exit(inode, map, flags, 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/trace/events/erofs.h:224:1: note: Returning without writing to 'map->m_flags'
DEFINE_EVENT(erofs__map_blocks_exit, erofs_map_blocks_exit,
^
include/linux/tracepoint.h:542:2: note: expanded from macro 'DEFINE_EVENT'
DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
^
include/linux/tracepoint.h:419:2: note: expanded from macro 'DECLARE_TRACE'
__DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \
^
include/linux/tracepoint.h:343:4: note: expanded from macro '__DECLARE_TRACE'
{ } \
^
fs/erofs/data.c:188:2: note: Returning from 'trace_erofs_map_blocks_exit'
trace_erofs_map_blocks_exit(inode, map, flags, 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/erofs/data.c:189:2: note: Returning without writing to 'map->m_flags'
return err;
^
fs/erofs/data.c:248:8: note: Returning from 'erofs_map_blocks'
ret = erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/erofs/data.c:249:6: note: 'ret' is >= 0
if (ret < 0)
^~~
fs/erofs/data.c:249:2: note: Taking false branch
if (ret < 0)
^
fs/erofs/data.c:257:6: note: Assuming 'ret' is 0
if (ret)
^~~
fs/erofs/data.c:257:2: note: Taking false branch
if (ret)
^
fs/erofs/data.c:261:2: note: Taking false branch
if (flags & IOMAP_DAX)
^
fs/erofs/data.c:269:20: note: The left operand of '&' is a garbage value
if (!(map.m_flags & EROFS_MAP_MAPPED)) {
~~~~~~~~~~~ ^
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.
64 warnings generated.
>> lib/maple_tree.c:326:2: warning: Value stored to 'node' is never read [clang-analyzer-deadcode.DeadStores]
node = (void *)((unsigned long)node & ~MAPLE_ENODE_NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:326:2: note: Value stored to 'node' is never read
node = (void *)((unsigned long)node & ~MAPLE_ENODE_NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:331:2: warning: Value stored to 'node' is never read [clang-analyzer-deadcode.DeadStores]
node = (void *)((unsigned long)node | MAPLE_ENODE_NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:331:2: note: Value stored to 'node' is never read
node = (void *)((unsigned long)node | MAPLE_ENODE_NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:1174:2: 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(reuse, 0, sizeof(*reuse));
^
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
^~~~~~~~~~~~~~~~
lib/maple_tree.c:1174:2: 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(reuse, 0, sizeof(*reuse));
^
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
^~~~~~~~~~~~~~~~
>> lib/maple_tree.c:1206:23: warning: Value stored to 'nodep' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct maple_alloc **nodep = &mas->alloc;
^~~~~ ~~~~~~~~~~~
lib/maple_tree.c:1206:23: note: Value stored to 'nodep' during its initialization is never read
struct maple_alloc **nodep = &mas->alloc;
^~~~~ ~~~~~~~~~~~
lib/maple_tree.c:1218:20: warning: Access to field 'node_count' results in a dereference of a null pointer (loaded from field 'alloc') [clang-analyzer-core.NullDereference]
if (!allocated || mas->alloc->node_count == MAPLE_ALLOC_SLOTS - 1) {
^
lib/maple_tree.c:6222:2: note: Calling 'trace_ma_op'
trace_ma_op(__func__, &mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/trace/events/maple_tree.h:13:1: note: Returning without writing to 'mas->alloc', which participates in a condition later
TRACE_EVENT(ma_op,
^
include/linux/tracepoint.h:553:2: note: expanded from macro 'TRACE_EVENT'
DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
^
include/linux/tracepoint.h:419:2: note: expanded from macro 'DECLARE_TRACE'
__DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \
^
include/linux/tracepoint.h:343:4: note: expanded from macro '__DECLARE_TRACE'
{ } \
^
include/trace/events/maple_tree.h:13:1: note: Returning without writing to 'mas->alloc'
TRACE_EVENT(ma_op,
^
include/linux/tracepoint.h:553:2: note: expanded from macro 'TRACE_EVENT'
DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
^
include/linux/tracepoint.h:419:2: note: expanded from macro 'DECLARE_TRACE'
__DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \
^
include/linux/tracepoint.h:343:4: note: expanded from macro '__DECLARE_TRACE'
{ } \
^
lib/maple_tree.c:6222:2: note: Returning from 'trace_ma_op'
trace_ma_op(__func__, &mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:6225:10: note: Calling 'mas_erase'
entry = mas_erase(&mas);
^~~~~~~~~~~~~~~
lib/maple_tree.c:5935:6: note: Calling 'mas_is_none'
if (mas_is_none(mas) || mas_is_paused(mas))
^~~~~~~~~~~~~~~~
include/linux/maple_tree.h:477:2: note: Returning without writing to 'mas->alloc', which participates in a condition later
return mas->node == MAS_NONE;
^
include/linux/maple_tree.h:477:2: note: Returning without writing to 'mas->alloc'
lib/maple_tree.c:5935:6: note: Returning from 'mas_is_none'
if (mas_is_none(mas) || mas_is_paused(mas))
^~~~~~~~~~~~~~~~
lib/maple_tree.c:5935:6: note: Left side of '||' is false
lib/maple_tree.c:5935:26: note: Calling 'mas_is_paused'
if (mas_is_none(mas) || mas_is_paused(mas))
^~~~~~~~~~~~~~~~~~
include/linux/maple_tree.h:483:2: note: Returning without writing to 'mas->alloc', which participates in a condition later
return mas->node == MAS_PAUSE;
^
include/linux/maple_tree.h:483:2: note: Returning without writing to 'mas->alloc'
lib/maple_tree.c:5935:26: note: Returning from 'mas_is_paused'
if (mas_is_none(mas) || mas_is_paused(mas))
^~~~~~~~~~~~~~~~~~
lib/maple_tree.c:5935:2: note: Taking false branch
if (mas_is_none(mas) || mas_is_paused(mas))
^
lib/maple_tree.c:5939:10: note: Calling 'mas_state_walk'
entry = mas_state_walk(mas);
^~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:3745:10: note: Calling 'mas_start'
entry = mas_start(mas);
^~~~~~~~~~~~~~
lib/maple_tree.c:1322:13: note: Calling 'mas_is_start'
if (likely(mas_is_start(mas))) {
^
include/linux/compiler.h:77:40: note: expanded from macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
lib/maple_tree.c:243:2: note: Returning without writing to 'mas->alloc', which participates in a condition later
return mas->node == MAS_START;
^
lib/maple_tree.c:243:2: note: Returning without writing to 'mas->alloc'
lib/maple_tree.c:1322:13: note: Returning from 'mas_is_start'
if (likely(mas_is_start(mas))) {
^
include/linux/compiler.h:77:40: note: expanded from macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
lib/maple_tree.c:1322:2: note: Taking true branch
if (likely(mas_is_start(mas))) {
^
lib/maple_tree.c:1331:10: note: Calling 'mas_root'
root = mas_root(mas);
^~~~~~~~~~~~~
lib/maple_tree.c:844:9: note: Left side of '||' is false
return rcu_dereference_check(mas->tree->ma_root, mt_locked(mas->tree));
^
include/linux/rcupdate.h:531:2: note: expanded from macro 'rcu_dereference_check'
__rcu_dereference_check((p), __UNIQUE_ID(rcu), \
^
include/linux/rcupdate.h:391:43: note: expanded from macro '__rcu_dereference_check'
--
if (likely(mas->node != MA_ERROR(-ENOMEM))) {
^
include/linux/compiler.h:77:40: note: expanded from macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
lib/maple_tree.c:5965:2: note: Taking false branch
if (likely(mas->node != MA_ERROR(-ENOMEM))) {
^
lib/maple_tree.c:5970:6: note: Left side of '&&' is true
if (gfpflags_allow_blocking(gfp) && !mt_external_lock(mas->tree)) {
^
lib/maple_tree.c:5970:2: note: Taking false branch
if (gfpflags_allow_blocking(gfp) && !mt_external_lock(mas->tree)) {
^
lib/maple_tree.c:5975:3: note: Calling 'mas_alloc_nodes'
mas_alloc_nodes(mas, gfp);
^~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:1207:28: note: Calling 'mas_allocated'
unsigned long allocated = mas_allocated(mas);
^~~~~~~~~~~~~~~~~~
lib/maple_tree.c:564:6: note: Assuming field 'alloc' is non-null, which participates in a condition later
if (!mas->alloc || ((unsigned long)mas->alloc & 0x1))
^~~~~~~~~~~
lib/maple_tree.c:564:6: note: Left side of '||' is false
lib/maple_tree.c:564:22: note: Assuming the condition is false
if (!mas->alloc || ((unsigned long)mas->alloc & 0x1))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:564:2: note: Taking false branch
if (!mas->alloc || ((unsigned long)mas->alloc & 0x1))
^
lib/maple_tree.c:567:2: note: Returning value, which participates in a condition later
return mas->alloc->total;
^~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:1207:28: note: Returning from 'mas_allocated'
unsigned long allocated = mas_allocated(mas);
^~~~~~~~~~~~~~~~~~
lib/maple_tree.c:1214:6: note: Assuming 'requested' is not equal to 0
if (!requested)
^~~~~~~~~~
lib/maple_tree.c:1214:2: note: Taking false branch
if (!requested)
^
lib/maple_tree.c:1217:2: note: Calling 'mas_set_alloc_req'
mas_set_alloc_req(mas, 0);
^~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:582:12: note: Field 'alloc' is non-null, which participates in a condition later
if (!mas->alloc || ((unsigned long)mas->alloc & 0x1)) {
^
lib/maple_tree.c:582:6: note: Left side of '||' is false
if (!mas->alloc || ((unsigned long)mas->alloc & 0x1)) {
^
lib/maple_tree.c:582:22: note: Assuming the condition is true
if (!mas->alloc || ((unsigned long)mas->alloc & 0x1)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:582:2: note: Taking true branch
if (!mas->alloc || ((unsigned long)mas->alloc & 0x1)) {
^
lib/maple_tree.c:583:8: note: 'count' is 0
if (!count)
^~~~~
lib/maple_tree.c:583:3: note: Taking true branch
if (!count)
^
lib/maple_tree.c:584:4: note: Null pointer value stored to 'mas.alloc'
mas->alloc = NULL;
^~~~~~~~~~~~~~~~~
lib/maple_tree.c:1217:2: note: Returning from 'mas_set_alloc_req'
mas_set_alloc_req(mas, 0);
^~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:1218:6: note: Assuming 'allocated' is not equal to 0
if (!allocated || mas->alloc->node_count == MAPLE_ALLOC_SLOTS - 1) {
^~~~~~~~~~
lib/maple_tree.c:1218:6: note: Left side of '||' is false
lib/maple_tree.c:1218:20: note: Access to field 'node_count' results in a dereference of a null pointer (loaded from field 'alloc')
if (!allocated || mas->alloc->node_count == MAPLE_ALLOC_SLOTS - 1) {
^ ~~~~~
lib/maple_tree.c:1263:2: 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(slots, 0, max_req * sizeof(unsigned long));
^
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
^~~~~~~~~~~~~~~~
lib/maple_tree.c:1263:2: 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(slots, 0, max_req * sizeof(unsigned long));
^
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
^~~~~~~~~~~~~~~~
>> lib/maple_tree.c:1696:3: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
rcu_assign_pointer(slots[offset], mas->node);
^
include/linux/rcupdate.h:455:3: note: expanded from macro 'rcu_assign_pointer'
smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
^
include/asm-generic/barrier.h:190:2: note: expanded from macro 'smp_store_release'
WRITE_ONCE(*p, v); \
^
include/asm-generic/rwonce.h:61:2: note: expanded from macro 'WRITE_ONCE'
__WRITE_ONCE(x, val); \
^
include/asm-generic/rwonce.h:55:30: note: expanded from macro '__WRITE_ONCE'
*(volatile typeof(x) *)&(x) = (val); \
^
lib/maple_tree.c:6225:10: note: Calling 'mas_erase'
entry = mas_erase(&mas);
^~~~~~~~~~~~~~~
lib/maple_tree.c:5935:6: note: Left side of '||' is false
if (mas_is_none(mas) || mas_is_paused(mas))
^
lib/maple_tree.c:5935:2: note: Taking false branch
if (mas_is_none(mas) || mas_is_paused(mas))
^
lib/maple_tree.c:5940:7: note: 'entry' is non-null
if (!entry)
^~~~~
lib/maple_tree.c:5940:2: note: Taking false branch
if (!entry)
^
lib/maple_tree.c:5947:2: note: Calling 'mas_wr_store_entry'
mas_wr_store_entry(&wr_mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:4265:7: note: Assuming field 'content' is null
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^~~~~~~~~~~~~~~
lib/maple_tree.c:4265:6: note: Left side of '||' is false
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^
lib/maple_tree.c:4265:6: note: Left side of '||' is false
lib/maple_tree.c:4265:2: note: Taking false branch
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^
lib/maple_tree.c:4271:2: note: Taking false branch
if (unlikely(!mas_wr_walk(wr_mas))) {
^
lib/maple_tree.c:4280:15: note: Field 'entry' is null
if (!wr_mas->entry)
^
lib/maple_tree.c:4280:2: note: Taking true branch
if (!wr_mas->entry)
^
lib/maple_tree.c:4284:21: note: Field 'index' is 0
if (unlikely(!mas->index && mas->last == ULONG_MAX)) {
^
lib/maple_tree.c:4284:15: note: Left side of '&&' is true
if (unlikely(!mas->index && mas->last == ULONG_MAX)) {
^
lib/maple_tree.c:4284:30: note: Assuming the condition is false
if (unlikely(!mas->index && mas->last == ULONG_MAX)) {
^
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
lib/maple_tree.c:4284:2: note: Taking false branch
if (unlikely(!mas->index && mas->last == ULONG_MAX)) {
^
lib/maple_tree.c:4289:2: note: Calling 'mas_wr_modify'
mas_wr_modify(wr_mas);
^~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:4215:14: note: Field 'r_min' is equal to field 'index'
if (wr_mas->r_min == mas->index && wr_mas->r_max == mas->last) {
^
lib/maple_tree.c:4215:6: note: Left side of '&&' is true
if (wr_mas->r_min == mas->index && wr_mas->r_max == mas->last) {
^
lib/maple_tree.c:4215:37: note: Assuming field 'r_max' is not equal to field 'last'
if (wr_mas->r_min == mas->index && wr_mas->r_max == mas->last) {
^~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:4215:2: note: Taking false branch
if (wr_mas->r_min == mas->index && wr_mas->r_max == mas->last) {
^
lib/maple_tree.c:4225:6: note: Assuming the condition is false
if (mas->max == ULONG_MAX)
^~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:4225:2: note: Taking false branch
if (mas->max == ULONG_MAX)
^
lib/maple_tree.c:4229:2: note: Taking false branch
if (unlikely(node_size >= node_slots))
^
lib/maple_tree.c:4232:14: note: Field 'entry' is null
if (wr_mas->entry && (wr_mas->node_end < node_slots - 1) &&
^
lib/maple_tree.c:4232:20: note: Left side of '&&' is false
if (wr_mas->entry && (wr_mas->node_end < node_slots - 1) &&
^
lib/maple_tree.c:4239:6: note: Left side of '&&' is true
if ((wr_mas->offset_end - mas->offset <= 1) && mas_wr_slot_store(wr_mas))
^
lib/maple_tree.c:4239:49: note: Assuming the condition is false
--
#define memmove(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:46:30: note: expanded from macro '__underlying_memmove'
#define __underlying_memmove __builtin_memmove
^~~~~~~~~~~~~~~~~
lib/maple_tree.c:1752:3: note: Call to function 'memmove' 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 'memmove_s' in case of C11
memmove(b_node->gap + shift, b_node->gap, size);
^
include/linux/fortify-string.h:373:27: note: expanded from macro 'memmove'
#define memmove(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:46:30: note: expanded from macro '__underlying_memmove'
#define __underlying_memmove __builtin_memmove
^~~~~~~~~~~~~~~~~
lib/maple_tree.c:1920:2: 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(b_node->slot + mab_start, slots + mas_start, sizeof(void *) * j);
^
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
^~~~~~~~~~~~~~~~
lib/maple_tree.c:1920:2: 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(b_node->slot + mab_start, slots + mas_start, sizeof(void *) * j);
^
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
^~~~~~~~~~~~~~~~
lib/maple_tree.c:1923: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(b_node->gap + mab_start, gaps + mas_start,
^
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
^~~~~~~~~~~~~~~~
lib/maple_tree.c:1923: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(b_node->gap + mab_start, gaps + mas_start,
^
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
^~~~~~~~~~~~~~~~
lib/maple_tree.c:1986:2: 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(slots, b_node->slot + mab_start,
^
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
^~~~~~~~~~~~~~~~
lib/maple_tree.c:1986:2: 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(slots, b_node->slot + mab_start,
^
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
^~~~~~~~~~~~~~~~
>> lib/maple_tree.c:2808:2: warning: Value stored to 'last' is never read [clang-analyzer-deadcode.DeadStores]
last = next = mas->node;
^ ~~~~~~~~~~~~~~~~
lib/maple_tree.c:2808:2: note: Value stored to 'last' is never read
last = next = mas->node;
^ ~~~~~~~~~~~~~~~~
>> lib/maple_tree.c:2809:2: warning: Value stored to 'prev_min' is never read [clang-analyzer-deadcode.DeadStores]
prev_min = min = mas->min;
^ ~~~~~~~~~~~~~~
lib/maple_tree.c:2809:2: note: Value stored to 'prev_min' is never read
prev_min = min = mas->min;
^ ~~~~~~~~~~~~~~
lib/maple_tree.c:2934: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(mast->bn, 0, sizeof(struct maple_big_node));
^
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
^~~~~~~~~~~~~~~~
lib/maple_tree.c:2934: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(mast->bn, 0, sizeof(struct maple_big_node));
^
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
^~~~~~~~~~~~~~~~
>> lib/maple_tree.c:3004:2: warning: Address of stack memory associated with local variable 'destroy' is still referred to by the stack variable 'mast' upon returning to the caller. This will be a dangling reference [clang-analyzer-core.StackAddressEscape]
return mast->bn->b_end;
^
lib/maple_tree.c:6225:10: note: Calling 'mas_erase'
entry = mas_erase(&mas);
^~~~~~~~~~~~~~~
lib/maple_tree.c:5935:6: note: Left side of '||' is false
if (mas_is_none(mas) || mas_is_paused(mas))
^
lib/maple_tree.c:5935:2: note: Taking false branch
if (mas_is_none(mas) || mas_is_paused(mas))
^
lib/maple_tree.c:5940:7: note: 'entry' is non-null
if (!entry)
^~~~~
lib/maple_tree.c:5940:2: note: Taking false branch
if (!entry)
^
lib/maple_tree.c:5947:2: note: Calling 'mas_wr_store_entry'
mas_wr_store_entry(&wr_mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:4265:7: note: Assuming field 'content' is null
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^~~~~~~~~~~~~~~
lib/maple_tree.c:4265:6: note: Left side of '||' is false
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^
lib/maple_tree.c:4265:6: note: Left side of '||' is false
lib/maple_tree.c:4265:2: note: Taking false branch
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^
lib/maple_tree.c:4271:2: note: Taking true branch
if (unlikely(!mas_wr_walk(wr_mas))) {
^
lib/maple_tree.c:4272:3: note: Calling 'mas_wr_spanning_store'
mas_wr_spanning_store(wr_mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:3896:21: note: Field 'index' is 0
if (unlikely(!mas->index && mas->last == ULONG_MAX))
^
lib/maple_tree.c:3896:15: note: Left side of '&&' is true
if (unlikely(!mas->index && mas->last == ULONG_MAX))
^
lib/maple_tree.c:3896:2: note: Taking false branch
if (unlikely(!mas->index && mas->last == ULONG_MAX))
^
lib/maple_tree.c:3904:2: note: Taking false branch
if (mas_is_err(mas))
^
lib/maple_tree.c:3914:2: note: Taking true branch
if (r_mas.last + 1)
^
lib/maple_tree.c:3925:15: note: Field 'entry' is null
if (!wr_mas->entry) {
^
lib/maple_tree.c:3925:2: note: Taking true branch
if (!wr_mas->entry) {
^
lib/maple_tree.c:3936:12: note: Field 'offset' is > field 'node_end'
if (r_mas.offset <= r_wr_mas.node_end)
^
lib/maple_tree.c:3936:2: note: Taking false branch
if (r_mas.offset <= r_wr_mas.node_end)
^
lib/maple_tree.c:3946:9: note: Calling 'mas_spanning_rebalance'
return mas_spanning_rebalance(mas, &mast, height + 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:2899:6: note: Left side of '&&' is true
if (!mas_is_root_limits(mast->orig_l) &&
^
lib/maple_tree.c:2900:6: note: Assuming the condition is false
unlikely(mast->bn->b_end <= mt_min_slots[mast->bn->type])) {
^
include/linux/compiler.h:78:22: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:2899:2: note: Taking false branch
if (!mas_is_root_limits(mast->orig_l) &&
^
lib/maple_tree.c:2921:2: note: Loop condition is true. Entering loop body
while (count--) {
^
lib/maple_tree.c:2939:3: note: Taking false branch
if (mas_is_root_limits(mast->l))
^
lib/maple_tree.c:2954:3: note: Taking false branch
if (mast_sufficient(mast))
^
lib/maple_tree.c:2957:3: note: Taking false branch
if (mast_overflow(mast))
^
lib/maple_tree.c:2961:3: note: Taking false branch
if (mas_is_root_limits(mast->orig_l))
^
lib/maple_tree.c:2965:3: note: Taking true branch
if (!mast_sibling_rebalance_right(mast, true))
^
lib/maple_tree.c:2966:4: note: Taking true branch
if (!mast_cousin_rebalance_right(mast, true))
^
lib/maple_tree.c:2967:5: note: Execution continues on line 2973
break;
^
lib/maple_tree.c:2978:6: note: 'middle' is null
if (middle)
^~~~~~
lib/maple_tree.c:2978:2: note: Taking false branch
if (middle)
^
lib/maple_tree.c:2981:6: note: 'right' is null
if (right)
^~~~~
lib/maple_tree.c:2981:2: note: Taking false branch
if (right)
^
lib/maple_tree.c:2984:2: note: Taking false branch
if (mas_is_root_limits(mast->l)) {
^
lib/maple_tree.c:2991:2: note: Taking true branch
if (!mte_dead_node(mast->orig_l->node))
^
lib/maple_tree.c:3004:2: note: Address of stack memory associated with local variable 'destroy' is still referred to by the stack variable 'mast' upon returning to the caller. This will be a dangling reference
return mast->bn->b_end;
^
>> lib/maple_tree.c:3004:2: warning: Address of stack memory associated with local variable 'free' is still referred to by the stack variable 'mast' upon returning to the caller. This will be a dangling reference [clang-analyzer-core.StackAddressEscape]
return mast->bn->b_end;
^
lib/maple_tree.c:6225:10: note: Calling 'mas_erase'
entry = mas_erase(&mas);
^~~~~~~~~~~~~~~
lib/maple_tree.c:5935:6: note: Left side of '||' is false
if (mas_is_none(mas) || mas_is_paused(mas))
^
lib/maple_tree.c:5935:2: note: Taking false branch
if (mas_is_none(mas) || mas_is_paused(mas))
^
lib/maple_tree.c:5940:7: note: 'entry' is non-null
if (!entry)
^~~~~
lib/maple_tree.c:5940:2: note: Taking false branch
if (!entry)
^
lib/maple_tree.c:5947:2: note: Calling 'mas_wr_store_entry'
mas_wr_store_entry(&wr_mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:4265:7: note: Assuming field 'content' is null
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^~~~~~~~~~~~~~~
lib/maple_tree.c:4265:6: note: Left side of '||' is false
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^
lib/maple_tree.c:4265:6: note: Left side of '||' is false
lib/maple_tree.c:4265:2: note: Taking false branch
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^
lib/maple_tree.c:4271:2: note: Taking true branch
if (unlikely(!mas_wr_walk(wr_mas))) {
^
lib/maple_tree.c:4272:3: note: Calling 'mas_wr_spanning_store'
mas_wr_spanning_store(wr_mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:3896:21: note: Field 'index' is 0
if (unlikely(!mas->index && mas->last == ULONG_MAX))
^
lib/maple_tree.c:3896:15: note: Left side of '&&' is true
if (unlikely(!mas->index && mas->last == ULONG_MAX))
^
lib/maple_tree.c:3896:2: note: Taking false branch
if (unlikely(!mas->index && mas->last == ULONG_MAX))
^
lib/maple_tree.c:3904:2: note: Taking false branch
if (mas_is_err(mas))
^
lib/maple_tree.c:3914:2: note: Taking true branch
if (r_mas.last + 1)
^
lib/maple_tree.c:3925:15: note: Field 'entry' is null
if (!wr_mas->entry) {
^
lib/maple_tree.c:3925:2: note: Taking true branch
if (!wr_mas->entry) {
^
lib/maple_tree.c:3936:12: note: Field 'offset' is > field 'node_end'
if (r_mas.offset <= r_wr_mas.node_end)
^
lib/maple_tree.c:3936:2: note: Taking false branch
if (r_mas.offset <= r_wr_mas.node_end)
^
lib/maple_tree.c:3946:9: note: Calling 'mas_spanning_rebalance'
return mas_spanning_rebalance(mas, &mast, height + 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:2899:6: note: Left side of '&&' is true
if (!mas_is_root_limits(mast->orig_l) &&
^
lib/maple_tree.c:2900:6: note: Assuming the condition is false
unlikely(mast->bn->b_end <= mt_min_slots[mast->bn->type])) {
^
include/linux/compiler.h:78:22: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:2899:2: note: Taking false branch
if (!mas_is_root_limits(mast->orig_l) &&
^
lib/maple_tree.c:2921:2: note: Loop condition is true. Entering loop body
while (count--) {
^
lib/maple_tree.c:2939:3: note: Taking false branch
if (mas_is_root_limits(mast->l))
^
lib/maple_tree.c:2954:3: note: Taking false branch
if (mast_sufficient(mast))
^
lib/maple_tree.c:2957:3: note: Taking false branch
if (mast_overflow(mast))
^
lib/maple_tree.c:2961:3: note: Taking false branch
if (mas_is_root_limits(mast->orig_l))
^
lib/maple_tree.c:2965:3: note: Taking true branch
if (!mast_sibling_rebalance_right(mast, true))
^
lib/maple_tree.c:2966:4: note: Taking true branch
if (!mast_cousin_rebalance_right(mast, true))
^
lib/maple_tree.c:2967:5: note: Execution continues on line 2973
break;
^
lib/maple_tree.c:2978:6: note: 'middle' is null
if (middle)
^~~~~~
lib/maple_tree.c:2978:2: note: Taking false branch
if (middle)
^
lib/maple_tree.c:2981:6: note: 'right' is null
if (right)
^~~~~
lib/maple_tree.c:2981:2: note: Taking false branch
if (right)
^
lib/maple_tree.c:2984:2: note: Taking false branch
if (mas_is_root_limits(mast->l)) {
^
lib/maple_tree.c:2991:2: note: Taking true branch
if (!mte_dead_node(mast->orig_l->node))
^
lib/maple_tree.c:3004:2: note: Address of stack memory associated with local variable 'free' is still referred to by the stack variable 'mast' upon returning to the caller. This will be a dangling reference
return mast->bn->b_end;
^
>> lib/maple_tree.c:3004:2: warning: Address of stack memory associated with local variable 'l_mas' is still referred to by the stack variable 'mast' upon returning to the caller. This will be a dangling reference [clang-analyzer-core.StackAddressEscape]
return mast->bn->b_end;
^
lib/maple_tree.c:6225:10: note: Calling 'mas_erase'
entry = mas_erase(&mas);
^~~~~~~~~~~~~~~
lib/maple_tree.c:5935:6: note: Left side of '||' is false
if (mas_is_none(mas) || mas_is_paused(mas))
^
lib/maple_tree.c:5935:2: note: Taking false branch
if (mas_is_none(mas) || mas_is_paused(mas))
^
lib/maple_tree.c:5940:7: note: 'entry' is non-null
if (!entry)
^~~~~
lib/maple_tree.c:5940:2: note: Taking false branch
if (!entry)
^
lib/maple_tree.c:5947:2: note: Calling 'mas_wr_store_entry'
mas_wr_store_entry(&wr_mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:4265:7: note: Assuming field 'content' is null
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^~~~~~~~~~~~~~~
lib/maple_tree.c:4265:6: note: Left side of '||' is false
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^
lib/maple_tree.c:4265:6: note: Left side of '||' is false
lib/maple_tree.c:4265:2: note: Taking false branch
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^
lib/maple_tree.c:4271:2: note: Taking true branch
if (unlikely(!mas_wr_walk(wr_mas))) {
^
lib/maple_tree.c:4272:3: note: Calling 'mas_wr_spanning_store'
mas_wr_spanning_store(wr_mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:3896:21: note: Field 'index' is 0
if (unlikely(!mas->index && mas->last == ULONG_MAX))
^
lib/maple_tree.c:3896:15: note: Left side of '&&' is true
if (unlikely(!mas->index && mas->last == ULONG_MAX))
^
lib/maple_tree.c:3896:2: note: Taking false branch
if (unlikely(!mas->index && mas->last == ULONG_MAX))
^
lib/maple_tree.c:3904:2: note: Taking false branch
if (mas_is_err(mas))
^
lib/maple_tree.c:3914:2: note: Taking true branch
if (r_mas.last + 1)
^
lib/maple_tree.c:3925:15: note: Field 'entry' is null
if (!wr_mas->entry) {
^
lib/maple_tree.c:3925:2: note: Taking true branch
if (!wr_mas->entry) {
^
lib/maple_tree.c:3936:12: note: Field 'offset' is > field 'node_end'
if (r_mas.offset <= r_wr_mas.node_end)
^
lib/maple_tree.c:3936:2: note: Taking false branch
if (r_mas.offset <= r_wr_mas.node_end)
^
lib/maple_tree.c:3946:9: note: Calling 'mas_spanning_rebalance'
return mas_spanning_rebalance(mas, &mast, height + 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:2899:6: note: Left side of '&&' is true
if (!mas_is_root_limits(mast->orig_l) &&
^
lib/maple_tree.c:2900:6: note: Assuming the condition is false
unlikely(mast->bn->b_end <= mt_min_slots[mast->bn->type])) {
^
include/linux/compiler.h:78:22: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:2899:2: note: Taking false branch
if (!mas_is_root_limits(mast->orig_l) &&
^
lib/maple_tree.c:2921:2: note: Loop condition is true. Entering loop body
while (count--) {
^
lib/maple_tree.c:2939:3: note: Taking false branch
if (mas_is_root_limits(mast->l))
^
lib/maple_tree.c:2954:3: note: Taking false branch
if (mast_sufficient(mast))
^
lib/maple_tree.c:2957:3: note: Taking false branch
if (mast_overflow(mast))
^
lib/maple_tree.c:2961:3: note: Taking false branch
if (mas_is_root_limits(mast->orig_l))
^
lib/maple_tree.c:2965:3: note: Taking true branch
if (!mast_sibling_rebalance_right(mast, true))
^
lib/maple_tree.c:2966:4: note: Taking true branch
if (!mast_cousin_rebalance_right(mast, true))
^
lib/maple_tree.c:2967:5: note: Execution continues on line 2973
break;
^
lib/maple_tree.c:2978:6: note: 'middle' is null
if (middle)
^~~~~~
lib/maple_tree.c:2978:2: note: Taking false branch
if (middle)
^
lib/maple_tree.c:2981:6: note: 'right' is null
if (right)
^~~~~
lib/maple_tree.c:2981:2: note: Taking false branch
if (right)
^
lib/maple_tree.c:2984:2: note: Taking false branch
if (mas_is_root_limits(mast->l)) {
^
lib/maple_tree.c:2991:2: note: Taking true branch
if (!mte_dead_node(mast->orig_l->node))
^
lib/maple_tree.c:3004:2: note: Address of stack memory associated with local variable 'l_mas' is still referred to by the stack variable 'mast' upon returning to the caller. This will be a dangling reference
return mast->bn->b_end;
^
>> lib/maple_tree.c:3004:2: warning: Address of stack memory associated with local variable 'm_mas' is still referred to by the stack variable 'mast' upon returning to the caller. This will be a dangling reference [clang-analyzer-core.StackAddressEscape]
return mast->bn->b_end;
^
lib/maple_tree.c:6225:10: note: Calling 'mas_erase'
entry = mas_erase(&mas);
^~~~~~~~~~~~~~~
lib/maple_tree.c:5935:6: note: Left side of '||' is false
if (mas_is_none(mas) || mas_is_paused(mas))
^
lib/maple_tree.c:5935:2: note: Taking false branch
if (mas_is_none(mas) || mas_is_paused(mas))
^
lib/maple_tree.c:5940:7: note: 'entry' is non-null
if (!entry)
^~~~~
lib/maple_tree.c:5940:2: note: Taking false branch
if (!entry)
^
lib/maple_tree.c:5947:2: note: Calling 'mas_wr_store_entry'
mas_wr_store_entry(&wr_mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:4265:7: note: Assuming field 'content' is null
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^~~~~~~~~~~~~~~
lib/maple_tree.c:4265:6: note: Left side of '||' is false
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^
lib/maple_tree.c:4265:6: note: Left side of '||' is false
lib/maple_tree.c:4265:2: note: Taking false branch
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^
lib/maple_tree.c:4271:2: note: Taking true branch
if (unlikely(!mas_wr_walk(wr_mas))) {
^
lib/maple_tree.c:4272:3: note: Calling 'mas_wr_spanning_store'
mas_wr_spanning_store(wr_mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:3896:21: note: Field 'index' is 0
if (unlikely(!mas->index && mas->last == ULONG_MAX))
^
lib/maple_tree.c:3896:15: note: Left side of '&&' is true
if (unlikely(!mas->index && mas->last == ULONG_MAX))
^
lib/maple_tree.c:3896:2: note: Taking false branch
if (unlikely(!mas->index && mas->last == ULONG_MAX))
^
lib/maple_tree.c:3904:2: note: Taking false branch
if (mas_is_err(mas))
^
lib/maple_tree.c:3914:2: note: Taking true branch
if (r_mas.last + 1)
^
lib/maple_tree.c:3925:15: note: Field 'entry' is null
if (!wr_mas->entry) {
^
lib/maple_tree.c:3925:2: note: Taking true branch
if (!wr_mas->entry) {
^
lib/maple_tree.c:3936:12: note: Field 'offset' is > field 'node_end'
if (r_mas.offset <= r_wr_mas.node_end)
^
lib/maple_tree.c:3936:2: note: Taking false branch
if (r_mas.offset <= r_wr_mas.node_end)
^
lib/maple_tree.c:3946:9: note: Calling 'mas_spanning_rebalance'
return mas_spanning_rebalance(mas, &mast, height + 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:2899:6: note: Left side of '&&' is true
if (!mas_is_root_limits(mast->orig_l) &&
^
lib/maple_tree.c:2900:6: note: Assuming the condition is false
unlikely(mast->bn->b_end <= mt_min_slots[mast->bn->type])) {
^
include/linux/compiler.h:78:22: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:2899:2: note: Taking false branch
if (!mas_is_root_limits(mast->orig_l) &&
^
lib/maple_tree.c:2921:2: note: Loop condition is true. Entering loop body
while (count--) {
^
lib/maple_tree.c:2939:3: note: Taking false branch
if (mas_is_root_limits(mast->l))
^
lib/maple_tree.c:2954:3: note: Taking false branch
if (mast_sufficient(mast))
^
lib/maple_tree.c:2957:3: note: Taking false branch
if (mast_overflow(mast))
^
lib/maple_tree.c:2961:3: note: Taking false branch
if (mas_is_root_limits(mast->orig_l))
^
lib/maple_tree.c:2965:3: note: Taking true branch
if (!mast_sibling_rebalance_right(mast, true))
^
lib/maple_tree.c:2966:4: note: Taking true branch
if (!mast_cousin_rebalance_right(mast, true))
^
lib/maple_tree.c:2967:5: note: Execution continues on line 2973
break;
^
lib/maple_tree.c:2978:6: note: 'middle' is null
if (middle)
^~~~~~
lib/maple_tree.c:2978:2: note: Taking false branch
if (middle)
^
lib/maple_tree.c:2981:6: note: 'right' is null
if (right)
^~~~~
lib/maple_tree.c:2981:2: note: Taking false branch
if (right)
^
lib/maple_tree.c:2984:2: note: Taking false branch
if (mas_is_root_limits(mast->l)) {
^
lib/maple_tree.c:2991:2: note: Taking true branch
if (!mte_dead_node(mast->orig_l->node))
^
lib/maple_tree.c:3004:2: note: Address of stack memory associated with local variable 'm_mas' is still referred to by the stack variable 'mast' upon returning to the caller. This will be a dangling reference
return mast->bn->b_end;
^
>> lib/maple_tree.c:3004:2: warning: Address of stack memory associated with local variable 'r_mas' is still referred to by the stack variable 'mast' upon returning to the caller. This will be a dangling reference [clang-analyzer-core.StackAddressEscape]
return mast->bn->b_end;
^
lib/maple_tree.c:6225:10: note: Calling 'mas_erase'
entry = mas_erase(&mas);
^~~~~~~~~~~~~~~
lib/maple_tree.c:5935:6: note: Left side of '||' is false
if (mas_is_none(mas) || mas_is_paused(mas))
^
lib/maple_tree.c:5935:2: note: Taking false branch
if (mas_is_none(mas) || mas_is_paused(mas))
^
lib/maple_tree.c:5940:7: note: 'entry' is non-null
if (!entry)
^~~~~
lib/maple_tree.c:5940:2: note: Taking false branch
if (!entry)
^
lib/maple_tree.c:5947:2: note: Calling 'mas_wr_store_entry'
mas_wr_store_entry(&wr_mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:4265:7: note: Assuming field 'content' is null
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^~~~~~~~~~~~~~~
lib/maple_tree.c:4265:6: note: Left side of '||' is false
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^
lib/maple_tree.c:4265:6: note: Left side of '||' is false
lib/maple_tree.c:4265:2: note: Taking false branch
if ((wr_mas->content = mas_start(mas)) || mas_is_none(mas) ||
^
lib/maple_tree.c:4271:2: note: Taking true branch
if (unlikely(!mas_wr_walk(wr_mas))) {
^
lib/maple_tree.c:4272:3: note: Calling 'mas_wr_spanning_store'
mas_wr_spanning_store(wr_mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:3896:21: note: Field 'index' is 0
if (unlikely(!mas->index && mas->last == ULONG_MAX))
^
lib/maple_tree.c:3896:15: note: Left side of '&&' is true
if (unlikely(!mas->index && mas->last == ULONG_MAX))
^
lib/maple_tree.c:3896:2: note: Taking false branch
if (unlikely(!mas->index && mas->last == ULONG_MAX))
^
lib/maple_tree.c:3904:2: note: Taking false branch
if (mas_is_err(mas))
^
lib/maple_tree.c:3914:2: note: Taking true branch
if (r_mas.last + 1)
^
lib/maple_tree.c:3925:15: note: Field 'entry' is null
if (!wr_mas->entry) {
^
lib/maple_tree.c:3925:2: note: Taking true branch
if (!wr_mas->entry) {
^
lib/maple_tree.c:3936:12: note: Field 'offset' is > field 'node_end'
if (r_mas.offset <= r_wr_mas.node_end)
^
lib/maple_tree.c:3936:2: note: Taking false branch
if (r_mas.offset <= r_wr_mas.node_end)
^
lib/maple_tree.c:3946:9: note: Calling 'mas_spanning_rebalance'
return mas_spanning_rebalance(mas, &mast, height + 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:2899:6: note: Left side of '&&' is true
if (!mas_is_root_limits(mast->orig_l) &&
^
lib/maple_tree.c:2900:6: note: Assuming the condition is false
unlikely(mast->bn->b_end <= mt_min_slots[mast->bn->type])) {
^
include/linux/compiler.h:78:22: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~
lib/maple_tree.c:2899:2: note: Taking false branch
if (!mas_is_root_limits(mast->orig_l) &&
^
lib/maple_tree.c:2921:2: note: Loop condition is true. Entering loop body
while (count--) {
^
lib/maple_tree.c:2939:3: note: Taking false branch
if (mas_is_root_limits(mast->l))
^
lib/maple_tree.c:2954:3: note: Taking false branch
if (mast_sufficient(mast))
^
lib/maple_tree.c:2957:3: note: Taking false branch
if (mast_overflow(mast))
^
lib/maple_tree.c:2961:3: note: Taking false branch
if (mas_is_root_limits(mast->orig_l))
^
lib/maple_tree.c:2965:3: note: Taking true branch
if (!mast_sibling_rebalance_right(mast, true))
^
lib/maple_tree.c:2966:4: note: Taking true branch
if (!mast_cousin_rebalance_right(mast, true))
^
lib/maple_tree.c:2967:5: note: Execution continues on line 2973
--
^
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
^~~~~~~~~~~~~~~~
lib/maple_tree.c:4043:2: 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(dst_slots + dst_offset, wr_mas->slots + wr_mas->offset_end,
^
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
^~~~~~~~~~~~~~~~
lib/maple_tree.c:4048: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(dst_pivots + dst_offset, wr_mas->pivots + wr_mas->offset_end,
^
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
^~~~~~~~~~~~~~~~
lib/maple_tree.c:4048: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(dst_pivots + dst_offset, wr_mas->pivots + wr_mas->offset_end,
^
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
^~~~~~~~~~~~~~~~
lib/maple_tree.c:4061: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(wr_mas->node, newnode, sizeof(struct maple_node));
^
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
^~~~~~~~~~~~~~~~
lib/maple_tree.c:4061: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(wr_mas->node, newnode, sizeof(struct maple_node));
^
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
^~~~~~~~~~~~~~~~
lib/maple_tree.c:4248:2: 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(&b_node, 0, sizeof(struct maple_big_node));
^
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
^~~~~~~~~~~~~~~~
lib/maple_tree.c:4248:2: 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(&b_node, 0, sizeof(struct maple_big_node));
^
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
^~~~~~~~~~~~~~~~
>> lib/maple_tree.c:4890:5: warning: Value stored to 'count' is never read [clang-analyzer-deadcode.DeadStores]
count = mt_slots[type];
^ ~~~~~~~~~~~~~~
lib/maple_tree.c:4890:5: note: Value stored to 'count' is never read
count = mt_slots[type];
^ ~~~~~~~~~~~~~~
Suppressed 17 warnings (15 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.
58 warnings generated.
Suppressed 58 warnings (48 in non-user code, 10 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.
53 warnings generated.
mm/util.c:63: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(buf, s, 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
^~~~~~~~~~~~~~~~
mm/util.c:63: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(buf, s, 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
^~~~~~~~~~~~~~~~
mm/util.c:109: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(buf, s, 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
^~~~~~~~~~~~~~~~
mm/util.c:109: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(buf, s, 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
^~~~~~~~~~~~~~~~
mm/util.c:131: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(p, src, 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
^~~~~~~~~~~~~~~~
mm/util.c:131: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(p, src, 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
^~~~~~~~~~~~~~~~
mm/util.c:154: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(buf, s, 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'
vim +/node +326 lib/maple_tree.c
c11c433e3be4e5 Liam R. Howlett 2022-04-26 323
c11c433e3be4e5 Liam R. Howlett 2022-04-26 324 static inline void mte_set_full(const struct maple_enode *node)
c11c433e3be4e5 Liam R. Howlett 2022-04-26 325 {
c11c433e3be4e5 Liam R. Howlett 2022-04-26 @326 node = (void *)((unsigned long)node & ~MAPLE_ENODE_NULL);
c11c433e3be4e5 Liam R. Howlett 2022-04-26 327 }
c11c433e3be4e5 Liam R. Howlett 2022-04-26 328
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 months
[agd5f:drm-next-5.19 250/267] drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:410:2: warning: Value stored to 'offset' 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: Alex Deucher <alexander.deucher(a)amd.com>
tree: https://gitlab.freedesktop.org/agd5f/linux.git drm-next-5.19
head: 3da2c38231a4c62dafdbd762a199cfacaccd0533
commit: f716113aacea122e44e7a28aa521318da65adc84 [250/267] drm/amdgpu/discovery: add additional validation
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: arm-randconfig-c002-20220428 (https://download.01.org/0day-ci/archive/20220501/202205010224.x0oB4ZZo-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 400775649969b9baf3bc2a510266e7912bb16ae9)
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
git remote add agd5f https://gitlab.freedesktop.org/agd5f/linux.git
git fetch --no-tags agd5f drm-next-5.19
git checkout f716113aacea122e44e7a28aa521318da65adc84
# 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 >>)
if ((c) && debug_lockdep_rcu_enabled() && !__warned) { \
^
kernel/cred.c:361:22: note: Left side of '&&' is false
inc_rlimit_ucounts(task_ucounts(p), UCOUNT_RLIMIT_NPROC, 1);
^
include/linux/cred.h:374:29: note: expanded from macro 'task_ucounts'
#define task_ucounts(task) (task_cred_xxx((task), ucounts))
^
include/linux/cred.h:367:11: note: expanded from macro 'task_cred_xxx'
___val = __task_cred((task))->xxx; \
^
include/linux/cred.h:321:2: note: expanded from macro '__task_cred'
rcu_dereference((task)->real_cred)
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/rcupdate.h:531:2: note: expanded from macro 'rcu_dereference_check'
__rcu_dereference_check((p), __UNIQUE_ID(rcu), \
^
include/linux/rcupdate.h:392:2: note: expanded from macro '__rcu_dereference_check'
RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \
^
include/linux/rcupdate.h:319:11: note: expanded from macro 'RCU_LOCKDEP_WARN'
if ((c) && debug_lockdep_rcu_enabled() && !__warned) { \
^
kernel/cred.c:361:22: note: Loop condition is false. Exiting loop
inc_rlimit_ucounts(task_ucounts(p), UCOUNT_RLIMIT_NPROC, 1);
^
include/linux/cred.h:374:29: note: expanded from macro 'task_ucounts'
#define task_ucounts(task) (task_cred_xxx((task), ucounts))
^
include/linux/cred.h:367:11: note: expanded from macro 'task_cred_xxx'
___val = __task_cred((task))->xxx; \
^
include/linux/cred.h:321:2: note: expanded from macro '__task_cred'
rcu_dereference((task)->real_cred)
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/rcupdate.h:531:2: note: expanded from macro 'rcu_dereference_check'
__rcu_dereference_check((p), __UNIQUE_ID(rcu), \
^
include/linux/rcupdate.h:392:2: note: expanded from macro '__rcu_dereference_check'
RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \
^
include/linux/rcupdate.h:317:2: note: expanded from macro 'RCU_LOCKDEP_WARN'
do { \
^
kernel/cred.c:361:22: note: Access to field 'ucounts' results in a dereference of a null pointer
inc_rlimit_ucounts(task_ucounts(p), UCOUNT_RLIMIT_NPROC, 1);
^
include/linux/cred.h:374:29: note: expanded from macro 'task_ucounts'
#define task_ucounts(task) (task_cred_xxx((task), ucounts))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/cred.h:367:11: note: expanded from macro 'task_cred_xxx'
___val = __task_cred((task))->xxx; \
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/cred.h:321:2: note: expanded from macro '__task_cred'
rcu_dereference((task)->real_cred)
^
include/linux/rcupdate.h:603:28: note: expanded from macro 'rcu_dereference'
#define rcu_dereference(p) rcu_dereference_check(p, 0)
^
include/linux/rcupdate.h:531:2: note: expanded from macro 'rcu_dereference_check'
__rcu_dereference_check((p), __UNIQUE_ID(rcu), \
^
include/linux/rcupdate.h:388:53: note: expanded from macro '__rcu_dereference_check'
#define __rcu_dereference_check(p, local, c, space) \
^
Suppressed 15 warnings (15 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.
16 warnings generated.
kernel/resource.c:91:2: warning: The expression is an uninitialized value. The computed value will also be garbage [clang-analyzer-core.uninitialized.Assign]
(*pos)++;
^
kernel/resource.c:1679:2: note: 'l' declared without an initial value
loff_t l;
^~~~~~~~
kernel/resource.c:1682:2: note: Loop condition is true. Entering loop body
for (p = p->child; p ; p = r_next(NULL, p, &l)) {
^
kernel/resource.c:1687:7: note: Assuming the condition is true
if (p->start >= addr + size)
^~~~~~~~~~~~~~~~~~~~~~~
kernel/resource.c:1687:3: note: Taking true branch
if (p->start >= addr + size)
^
kernel/resource.c:1688:4: note: Execution continues on line 1682
continue;
^
kernel/resource.c:1682:29: note: Calling 'r_next'
for (p = p->child; p ; p = r_next(NULL, p, &l)) {
^~~~~~~~~~~~~~~~~~~
kernel/resource.c:91:2: note: The expression is an uninitialized value. The computed value will also be garbage
(*pos)++;
^~~~~~
Suppressed 15 warnings (15 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.
16 warnings generated.
Suppressed 16 warnings (16 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.
19 warnings generated.
>> drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:410:2: warning: Value stored to 'offset' is never read [clang-analyzer-deadcode.DeadStores]
offset = le16_to_cpu(info->offset);
^
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:410:2: note: Value stored to 'offset' is never read
>> drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:411:2: warning: Value stored to 'checksum' is never read [clang-analyzer-deadcode.DeadStores]
checksum = le16_to_cpu(info->checksum);
^
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:411:2: note: Value stored to 'checksum' is never read
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:887:4: warning: Value stored to 'res' is never read [clang-analyzer-deadcode.DeadStores]
res = kobject_add(&ip_hw_instance->kobj, NULL,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:887:4: note: Value stored to 'res' is never read
res = kobject_add(&ip_hw_instance->kobj, NULL,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 16 warnings (16 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.
16 warnings generated.
Suppressed 16 warnings (16 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.
16 warnings generated.
Suppressed 16 warnings (16 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.
16 warnings generated.
Suppressed 16 warnings (16 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.
16 warnings generated.
Suppressed 16 warnings (16 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.
15 warnings generated.
Suppressed 15 warnings (15 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.
15 warnings generated.
Suppressed 15 warnings (15 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.
15 warnings generated.
Suppressed 15 warnings (15 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.
15 warnings generated.
Suppressed 15 warnings (15 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.
fs/fuse/cuse.c:359:2: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores]
rc = -ENOMEM;
^ ~~~~~~~
fs/fuse/cuse.c:359:2: note: Value stored to 'rc' is never read
rc = -ENOMEM;
^ ~~~~~~~
fs/fuse/cuse.c:386:2: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores]
rc = -ENOMEM;
^ ~~~~~~~
fs/fuse/cuse.c:386:2: note: Value stored to 'rc' is never read
rc = -ENOMEM;
^ ~~~~~~~
Suppressed 15 warnings (15 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.
16 warnings generated.
Suppressed 16 warnings (16 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.
16 warnings generated.
Suppressed 16 warnings (16 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.
16 warnings generated.
Suppressed 16 warnings (16 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.
Suppressed 17 warnings (16 in non-user code, 1 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.
17 warnings generated.
Suppressed 17 warnings (17 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.
Suppressed 17 warnings (17 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.
Suppressed 17 warnings (17 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.
Suppressed 17 warnings (17 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.
Suppressed 17 warnings (17 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.
20 warnings generated.
fs/ext4/extents.c:3127:12: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
ee_block = le32_to_cpu(ex->ee_block);
^
fs/ext4/extents.c:3429:2: note: Taking false branch
ext_debug(inode, "logical block %llu, max_blocks %u\n",
^
fs/ext4/ext4.h:94:2: note: expanded from macro 'ext_debug'
pr_debug("[%s/%d] EXT4-fs (%s): ino %lu: (%s, %d): %s:" fmt, \
^
include/linux/printk.h:576:2: note: expanded from macro 'pr_debug'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^
include/linux/printk.h:131:2: note: expanded from macro 'no_printk'
if (0) \
^
fs/ext4/extents.c:3435:6: note: Assuming the condition is false
if (eof_block < map->m_lblk + map_len)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ext4/extents.c:3435:2: note: Taking false branch
if (eof_block < map->m_lblk + map_len)
^
fs/ext4/extents.c:3449:2: note: Taking false branch
vim +/offset +410 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
03f6fb84bd0e98 Guchun Chen 2022-01-14 269
dffa11b4f74b15 Monk Liu 2020-03-04 270 static int amdgpu_discovery_init(struct amdgpu_device *adev)
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 271 {
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 272 struct table_info *info;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 273 struct binary_header *bhdr;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 274 uint16_t offset;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 275 uint16_t size;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 276 uint16_t checksum;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 277 int r;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 278
72de33f8f7ba0f Alex Deucher 2020-07-29 279 adev->mman.discovery_tmr_size = DISCOVERY_TMR_SIZE;
72de33f8f7ba0f Alex Deucher 2020-07-29 280 adev->mman.discovery_bin = kzalloc(adev->mman.discovery_tmr_size, GFP_KERNEL);
72de33f8f7ba0f Alex Deucher 2020-07-29 281 if (!adev->mman.discovery_bin)
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 282 return -ENOMEM;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 283
f6dcaf0c07480f Hawking Zhang 2021-11-22 284 r = amdgpu_discovery_read_binary_from_vram(adev, adev->mman.discovery_bin);
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 285 if (r) {
2cb6577a303425 Hawking Zhang 2021-11-22 286 dev_err(adev->dev, "failed to read ip discovery binary from vram\n");
2cb6577a303425 Hawking Zhang 2021-11-22 287 r = -EINVAL;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 288 goto out;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 289 }
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 290
2cb6577a303425 Hawking Zhang 2021-11-22 291 if (!amdgpu_discovery_verify_binary_signature(adev->mman.discovery_bin)) {
2cb6577a303425 Hawking Zhang 2021-11-22 292 dev_warn(adev->dev, "get invalid ip discovery binary signature from vram\n");
2cb6577a303425 Hawking Zhang 2021-11-22 293 /* retry read ip discovery binary from file */
2cb6577a303425 Hawking Zhang 2021-11-22 294 r = amdgpu_discovery_read_binary_from_file(adev, adev->mman.discovery_bin);
2cb6577a303425 Hawking Zhang 2021-11-22 295 if (r) {
2cb6577a303425 Hawking Zhang 2021-11-22 296 dev_err(adev->dev, "failed to read ip discovery binary from file\n");
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 297 r = -EINVAL;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 298 goto out;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 299 }
2cb6577a303425 Hawking Zhang 2021-11-22 300 /* check the ip discovery binary signature */
2cb6577a303425 Hawking Zhang 2021-11-22 301 if(!amdgpu_discovery_verify_binary_signature(adev->mman.discovery_bin)) {
2cb6577a303425 Hawking Zhang 2021-11-22 302 dev_warn(adev->dev, "get invalid ip discovery binary signature from file\n");
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 303 r = -EINVAL;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 304 goto out;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 305 }
2cb6577a303425 Hawking Zhang 2021-11-22 306 }
2cb6577a303425 Hawking Zhang 2021-11-22 307
2cb6577a303425 Hawking Zhang 2021-11-22 308 bhdr = (struct binary_header *)adev->mman.discovery_bin;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 309
8e84aa1bf2af81 Xiaojie Yuan 2019-03-27 310 offset = offsetof(struct binary_header, binary_checksum) +
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 311 sizeof(bhdr->binary_checksum);
fd08953b2de911 Yang Wang 2021-11-24 312 size = le16_to_cpu(bhdr->binary_size) - offset;
fd08953b2de911 Yang Wang 2021-11-24 313 checksum = le16_to_cpu(bhdr->binary_checksum);
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 314
72de33f8f7ba0f Alex Deucher 2020-07-29 315 if (!amdgpu_discovery_verify_checksum(adev->mman.discovery_bin + offset,
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 316 size, checksum)) {
2cb6577a303425 Hawking Zhang 2021-11-22 317 dev_err(adev->dev, "invalid ip discovery binary checksum\n");
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 318 r = -EINVAL;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 319 goto out;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 320 }
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 321
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 322 info = &bhdr->table_list[IP_DISCOVERY];
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 323 offset = le16_to_cpu(info->offset);
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 324 checksum = le16_to_cpu(info->checksum);
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 325
f716113aacea12 Alex Deucher 2022-03-30 326 if (offset) {
f716113aacea12 Alex Deucher 2022-03-30 327 struct ip_discovery_header *ihdr =
f716113aacea12 Alex Deucher 2022-03-30 328 (struct ip_discovery_header *)(adev->mman.discovery_bin + offset);
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 329 if (le32_to_cpu(ihdr->signature) != DISCOVERY_TABLE_SIGNATURE) {
2cb6577a303425 Hawking Zhang 2021-11-22 330 dev_err(adev->dev, "invalid ip discovery data table signature\n");
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 331 r = -EINVAL;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 332 goto out;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 333 }
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 334
72de33f8f7ba0f Alex Deucher 2020-07-29 335 if (!amdgpu_discovery_verify_checksum(adev->mman.discovery_bin + offset,
fd08953b2de911 Yang Wang 2021-11-24 336 le16_to_cpu(ihdr->size), checksum)) {
2cb6577a303425 Hawking Zhang 2021-11-22 337 dev_err(adev->dev, "invalid ip discovery data table checksum\n");
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 338 r = -EINVAL;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 339 goto out;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 340 }
f716113aacea12 Alex Deucher 2022-03-30 341 }
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 342
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 343 info = &bhdr->table_list[GC];
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 344 offset = le16_to_cpu(info->offset);
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 345 checksum = le16_to_cpu(info->checksum);
f716113aacea12 Alex Deucher 2022-03-30 346
f716113aacea12 Alex Deucher 2022-03-30 347 if (offset) {
f716113aacea12 Alex Deucher 2022-03-30 348 struct gpu_info_header *ghdr =
f716113aacea12 Alex Deucher 2022-03-30 349 (struct gpu_info_header *)(adev->mman.discovery_bin + offset);
f716113aacea12 Alex Deucher 2022-03-30 350
f716113aacea12 Alex Deucher 2022-03-30 351 if (le32_to_cpu(ghdr->table_id) != GC_TABLE_ID) {
f716113aacea12 Alex Deucher 2022-03-30 352 dev_err(adev->dev, "invalid ip discovery gc table id\n");
f716113aacea12 Alex Deucher 2022-03-30 353 r = -EINVAL;
f716113aacea12 Alex Deucher 2022-03-30 354 goto out;
f716113aacea12 Alex Deucher 2022-03-30 355 }
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 356
72de33f8f7ba0f Alex Deucher 2020-07-29 357 if (!amdgpu_discovery_verify_checksum(adev->mman.discovery_bin + offset,
fd08953b2de911 Yang Wang 2021-11-24 358 le32_to_cpu(ghdr->size), checksum)) {
2cb6577a303425 Hawking Zhang 2021-11-22 359 dev_err(adev->dev, "invalid gc data table checksum\n");
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 360 r = -EINVAL;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 361 goto out;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 362 }
f716113aacea12 Alex Deucher 2022-03-30 363 }
f716113aacea12 Alex Deucher 2022-03-30 364
f716113aacea12 Alex Deucher 2022-03-30 365 info = &bhdr->table_list[HARVEST_INFO];
f716113aacea12 Alex Deucher 2022-03-30 366 offset = le16_to_cpu(info->offset);
f716113aacea12 Alex Deucher 2022-03-30 367 checksum = le16_to_cpu(info->checksum);
f716113aacea12 Alex Deucher 2022-03-30 368
f716113aacea12 Alex Deucher 2022-03-30 369 if (offset) {
f716113aacea12 Alex Deucher 2022-03-30 370 struct harvest_info_header *hhdr =
f716113aacea12 Alex Deucher 2022-03-30 371 (struct harvest_info_header *)(adev->mman.discovery_bin + offset);
f716113aacea12 Alex Deucher 2022-03-30 372
f716113aacea12 Alex Deucher 2022-03-30 373 if (le32_to_cpu(hhdr->signature) != HARVEST_TABLE_SIGNATURE) {
f716113aacea12 Alex Deucher 2022-03-30 374 dev_err(adev->dev, "invalid ip discovery harvest table signature\n");
f716113aacea12 Alex Deucher 2022-03-30 375 r = -EINVAL;
f716113aacea12 Alex Deucher 2022-03-30 376 goto out;
f716113aacea12 Alex Deucher 2022-03-30 377 }
f716113aacea12 Alex Deucher 2022-03-30 378
f716113aacea12 Alex Deucher 2022-03-30 379 if (!amdgpu_discovery_verify_checksum(adev->mman.discovery_bin + offset,
f716113aacea12 Alex Deucher 2022-03-30 380 sizeof(struct harvest_table), checksum)) {
f716113aacea12 Alex Deucher 2022-03-30 381 dev_err(adev->dev, "invalid harvest data table checksum\n");
f716113aacea12 Alex Deucher 2022-03-30 382 r = -EINVAL;
f716113aacea12 Alex Deucher 2022-03-30 383 goto out;
f716113aacea12 Alex Deucher 2022-03-30 384 }
f716113aacea12 Alex Deucher 2022-03-30 385 }
f716113aacea12 Alex Deucher 2022-03-30 386
f716113aacea12 Alex Deucher 2022-03-30 387 info = &bhdr->table_list[VCN_INFO];
f716113aacea12 Alex Deucher 2022-03-30 388 offset = le16_to_cpu(info->offset);
f716113aacea12 Alex Deucher 2022-03-30 389 checksum = le16_to_cpu(info->checksum);
f716113aacea12 Alex Deucher 2022-03-30 390
f716113aacea12 Alex Deucher 2022-03-30 391 if (offset) {
f716113aacea12 Alex Deucher 2022-03-30 392 struct vcn_info_header *vhdr =
f716113aacea12 Alex Deucher 2022-03-30 393 (struct vcn_info_header *)(adev->mman.discovery_bin + offset);
f716113aacea12 Alex Deucher 2022-03-30 394
f716113aacea12 Alex Deucher 2022-03-30 395 if (le32_to_cpu(vhdr->table_id) != VCN_INFO_TABLE_ID) {
f716113aacea12 Alex Deucher 2022-03-30 396 dev_err(adev->dev, "invalid ip discovery vcn table id\n");
f716113aacea12 Alex Deucher 2022-03-30 397 r = -EINVAL;
f716113aacea12 Alex Deucher 2022-03-30 398 goto out;
f716113aacea12 Alex Deucher 2022-03-30 399 }
f716113aacea12 Alex Deucher 2022-03-30 400
f716113aacea12 Alex Deucher 2022-03-30 401 if (!amdgpu_discovery_verify_checksum(adev->mman.discovery_bin + offset,
f716113aacea12 Alex Deucher 2022-03-30 402 le32_to_cpu(vhdr->size_bytes), checksum)) {
f716113aacea12 Alex Deucher 2022-03-30 403 dev_err(adev->dev, "invalid vcn data table checksum\n");
f716113aacea12 Alex Deucher 2022-03-30 404 r = -EINVAL;
f716113aacea12 Alex Deucher 2022-03-30 405 goto out;
f716113aacea12 Alex Deucher 2022-03-30 406 }
f716113aacea12 Alex Deucher 2022-03-30 407 }
f716113aacea12 Alex Deucher 2022-03-30 408
f716113aacea12 Alex Deucher 2022-03-30 409 info = &bhdr->table_list[MALL_INFO];
f716113aacea12 Alex Deucher 2022-03-30 @410 offset = le16_to_cpu(info->offset);
f716113aacea12 Alex Deucher 2022-03-30 @411 checksum = le16_to_cpu(info->checksum);
f716113aacea12 Alex Deucher 2022-03-30 412
f716113aacea12 Alex Deucher 2022-03-30 413 if (0 && offset) {
f716113aacea12 Alex Deucher 2022-03-30 414 struct mall_info_header *mhdr =
f716113aacea12 Alex Deucher 2022-03-30 415 (struct mall_info_header *)(adev->mman.discovery_bin + offset);
f716113aacea12 Alex Deucher 2022-03-30 416
f716113aacea12 Alex Deucher 2022-03-30 417 if (le32_to_cpu(mhdr->table_id) != MALL_INFO_TABLE_ID) {
f716113aacea12 Alex Deucher 2022-03-30 418 dev_err(adev->dev, "invalid ip discovery mall table id\n");
f716113aacea12 Alex Deucher 2022-03-30 419 r = -EINVAL;
f716113aacea12 Alex Deucher 2022-03-30 420 goto out;
f716113aacea12 Alex Deucher 2022-03-30 421 }
f716113aacea12 Alex Deucher 2022-03-30 422
f716113aacea12 Alex Deucher 2022-03-30 423 if (!amdgpu_discovery_verify_checksum(adev->mman.discovery_bin + offset,
f716113aacea12 Alex Deucher 2022-03-30 424 le32_to_cpu(mhdr->size_bytes), checksum)) {
f716113aacea12 Alex Deucher 2022-03-30 425 dev_err(adev->dev, "invalid mall data table checksum\n");
f716113aacea12 Alex Deucher 2022-03-30 426 r = -EINVAL;
f716113aacea12 Alex Deucher 2022-03-30 427 goto out;
f716113aacea12 Alex Deucher 2022-03-30 428 }
f716113aacea12 Alex Deucher 2022-03-30 429 }
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 430
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 431 return 0;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 432
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 433 out:
72de33f8f7ba0f Alex Deucher 2020-07-29 434 kfree(adev->mman.discovery_bin);
72de33f8f7ba0f Alex Deucher 2020-07-29 435 adev->mman.discovery_bin = NULL;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 436
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 437 return r;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 438 }
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 439
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 months
drivers/gpu/drm/radeon/radeon_atombios.c:2816:4: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
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: Chris Down <chris(a)chrisdown.name>
CC: Petr Mladek <pmladek(a)suse.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8013d1d3d2e33236dee13a133fba49ad55045e79
commit: 337015573718b161891a3473d25f59273f2e626b printk: Userspace format indexing support
date: 10 months ago
:::::: branch date: 19 hours ago
:::::: commit date: 10 months ago
config: arm-randconfig-c002-20220428 (https://download.01.org/0day-ci/archive/20220501/202205010156.eMTNAlU0-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://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 337015573718b161891a3473d25f59273f2e626b
# 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 >>)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
10 warnings generated.
Suppressed 10 warnings (10 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.
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.
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.
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.
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.
4 warnings generated.
lib/rbtree_test.c:309:3: warning: Value stored to 'node' is never read [clang-analyzer-deadcode.DeadStores]
node = rb_first(&root.rb_root);
^ ~~~~~~~~~~~~~~~~~~~~~~~
lib/rbtree_test.c:309:3: note: Value stored to 'node' is never read
node = rb_first(&root.rb_root);
^ ~~~~~~~~~~~~~~~~~~~~~~~
lib/rbtree_test.c:321:3: warning: Value stored to 'node' is never read [clang-analyzer-deadcode.DeadStores]
node = rb_first_cached(&root);
^
lib/rbtree_test.c:321:3: note: Value stored to 'node' is never read
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.
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.
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.
drivers/gpu/drm/radeon/radeon_drv.c:467:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = radeon_resume_kms(drm_dev, false, false);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/radeon/radeon_drv.c:467:2: note: Value stored to 'ret' is never read
ret = radeon_resume_kms(drm_dev, false, false);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
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.
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.
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.
58 warnings generated.
>> drivers/gpu/drm/radeon/radeon_atombios.c:2816:4: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/radeon/radeon_atombios.c:2765:6: note: Assuming the condition is true
if (atom_parse_data_header(mode_info->atom_context, index, NULL,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/radeon/radeon_atombios.c:2765:2: note: Taking true branch
if (atom_parse_data_header(mode_info->atom_context, index, NULL,
^
drivers/gpu/drm/radeon/radeon_atombios.c:2767:3: note: Control jumps to 'case 5:' at line 2774
switch (frev) {
^
drivers/gpu/drm/radeon/radeon_atombios.c:2776:4: note: Execution continues on line 2785
break;
^
drivers/gpu/drm/radeon/radeon_atombios.c:2785:6: note: 'state_index' is equal to 0
if (state_index == 0) {
^~~~~~~~~~~
drivers/gpu/drm/radeon/radeon_atombios.c:2785:2: note: Taking true branch
if (state_index == 0) {
^
drivers/gpu/drm/radeon/radeon_atombios.c:2786:26: note: Calling 'kzalloc'
rdev->pm.power_state = kzalloc(sizeof(struct radeon_power_state), GFP_KERNEL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/slab.h:721:9: note: Calling 'kmalloc'
return kmalloc(size, flags | __GFP_ZERO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/slab.h:579:2: note: Taking false branch
if (__builtin_constant_p(size)) {
^
include/linux/slab.h:596:2: note: Returning pointer
return __kmalloc(size, flags);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/slab.h:721:9: note: Returning from 'kmalloc'
return kmalloc(size, flags | __GFP_ZERO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/slab.h:721:2: note: Returning pointer
return kmalloc(size, flags | __GFP_ZERO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/radeon/radeon_atombios.c:2786:26: note: Returning from 'kzalloc'
rdev->pm.power_state = kzalloc(sizeof(struct radeon_power_state), GFP_KERNEL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/radeon/radeon_atombios.c:2786:3: note: Value assigned to field 'power_state'
rdev->pm.power_state = kzalloc(sizeof(struct radeon_power_state), GFP_KERNEL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/radeon/radeon_atombios.c:2787:7: note: Assuming field 'power_state' is null
if (rdev->pm.power_state) {
^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/radeon/radeon_atombios.c:2787:3: note: Taking false branch
if (rdev->pm.power_state) {
^
drivers/gpu/drm/radeon/radeon_atombios.c:2814:6: note: Assuming field 'default_power_state_index' is >= 0
if (rdev->pm.default_power_state_index >= 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/radeon/radeon_atombios.c:2814:2: note: Taking true branch
if (rdev->pm.default_power_state_index >= 0)
^
drivers/gpu/drm/radeon/radeon_atombios.c:2816:4: note: Dereference of null pointer
rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 57 warnings (8 in non-user code, 49 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.
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.
21 warnings generated.
kernel/sched/core.c:5206:16: warning: Value stored to 'preempt_disable_ip' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
unsigned long preempt_disable_ip = get_preempt_disable_ip(current);
^~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c:5206:16: note: Value stored to 'preempt_disable_ip' during its initialization is never read
unsigned long preempt_disable_ip = get_preempt_disable_ip(current);
^~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c:5940:3: warning: Value stored to 'rq' is never read [clang-analyzer-deadcode.DeadStores]
rq = context_switch(rq, prev, next, &rf);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c:5940:3: note: Value stored to 'rq' is never read
rq = context_switch(rq, prev, next, &rf);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c:8938:3: warning: Value stored to 'ptr' is never read [clang-analyzer-deadcode.DeadStores]
ptr += nr_cpu_ids * sizeof(void **);
^
kernel/sched/core.c:8938:3: note: Value stored to 'ptr' is never read
Suppressed 18 warnings (12 in non-user code, 6 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.
10 warnings generated.
Suppressed 10 warnings (10 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.
10 warnings generated.
Suppressed 10 warnings (10 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.
11 warnings generated.
kernel/sched/cputime.c:570:3: warning: Value stored to 'utime' is never read [clang-analyzer-deadcode.DeadStores]
utime = rtime;
^ ~~~~~
kernel/sched/cputime.c:570:3: note: Value stored to 'utime' is never read
utime = rtime;
^ ~~~~~
Suppressed 10 warnings (10 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.
10 warnings generated.
Suppressed 10 warnings (10 in non-user code).
vim +2816 drivers/gpu/drm/radeon/radeon_atombios.c
b0e664140a1703 Alex Deucher 2010-11-22 2754
560154e9a27f2f Alex Deucher 2010-11-22 2755 void radeon_atombios_get_power_modes(struct radeon_device *rdev)
560154e9a27f2f Alex Deucher 2010-11-22 2756 {
560154e9a27f2f Alex Deucher 2010-11-22 2757 struct radeon_mode_info *mode_info = &rdev->mode_info;
560154e9a27f2f Alex Deucher 2010-11-22 2758 int index = GetIndexIntoMasterTable(DATA, PowerPlayInfo);
560154e9a27f2f Alex Deucher 2010-11-22 2759 u16 data_offset;
560154e9a27f2f Alex Deucher 2010-11-22 2760 u8 frev, crev;
560154e9a27f2f Alex Deucher 2010-11-22 2761 int state_index = 0;
560154e9a27f2f Alex Deucher 2010-11-22 2762
560154e9a27f2f Alex Deucher 2010-11-22 2763 rdev->pm.default_power_state_index = -1;
560154e9a27f2f Alex Deucher 2010-11-22 2764
560154e9a27f2f Alex Deucher 2010-11-22 2765 if (atom_parse_data_header(mode_info->atom_context, index, NULL,
560154e9a27f2f Alex Deucher 2010-11-22 2766 &frev, &crev, &data_offset)) {
560154e9a27f2f Alex Deucher 2010-11-22 2767 switch (frev) {
560154e9a27f2f Alex Deucher 2010-11-22 2768 case 1:
560154e9a27f2f Alex Deucher 2010-11-22 2769 case 2:
560154e9a27f2f Alex Deucher 2010-11-22 2770 case 3:
560154e9a27f2f Alex Deucher 2010-11-22 2771 state_index = radeon_atombios_parse_power_table_1_3(rdev);
560154e9a27f2f Alex Deucher 2010-11-22 2772 break;
560154e9a27f2f Alex Deucher 2010-11-22 2773 case 4:
560154e9a27f2f Alex Deucher 2010-11-22 2774 case 5:
560154e9a27f2f Alex Deucher 2010-11-22 2775 state_index = radeon_atombios_parse_power_table_4_5(rdev);
560154e9a27f2f Alex Deucher 2010-11-22 2776 break;
b0e664140a1703 Alex Deucher 2010-11-22 2777 case 6:
b0e664140a1703 Alex Deucher 2010-11-22 2778 state_index = radeon_atombios_parse_power_table_6(rdev);
b0e664140a1703 Alex Deucher 2010-11-22 2779 break;
560154e9a27f2f Alex Deucher 2010-11-22 2780 default:
560154e9a27f2f Alex Deucher 2010-11-22 2781 break;
56278a8edacee9 Alex Deucher 2009-12-28 2782 }
f8e6bfc2ce1628 Alex Deucher 2013-04-25 2783 }
f8e6bfc2ce1628 Alex Deucher 2013-04-25 2784
f8e6bfc2ce1628 Alex Deucher 2013-04-25 2785 if (state_index == 0) {
0975b16274bad1 Alex Deucher 2011-02-02 2786 rdev->pm.power_state = kzalloc(sizeof(struct radeon_power_state), GFP_KERNEL);
0975b16274bad1 Alex Deucher 2011-02-02 2787 if (rdev->pm.power_state) {
8f3f1c9a22a642 Alex Deucher 2011-11-04 2788 rdev->pm.power_state[0].clock_info =
6396bb221514d2 Kees Cook 2018-06-12 2789 kcalloc(1,
6396bb221514d2 Kees Cook 2018-06-12 2790 sizeof(struct radeon_pm_clock_info),
6396bb221514d2 Kees Cook 2018-06-12 2791 GFP_KERNEL);
8f3f1c9a22a642 Alex Deucher 2011-11-04 2792 if (rdev->pm.power_state[0].clock_info) {
56278a8edacee9 Alex Deucher 2009-12-28 2793 /* add the default mode */
0ec0e74f784ca0 Alex Deucher 2009-12-23 2794 rdev->pm.power_state[state_index].type =
0ec0e74f784ca0 Alex Deucher 2009-12-23 2795 POWER_STATE_TYPE_DEFAULT;
56278a8edacee9 Alex Deucher 2009-12-28 2796 rdev->pm.power_state[state_index].num_clock_modes = 1;
56278a8edacee9 Alex Deucher 2009-12-28 2797 rdev->pm.power_state[state_index].clock_info[0].mclk = rdev->clock.default_mclk;
56278a8edacee9 Alex Deucher 2009-12-28 2798 rdev->pm.power_state[state_index].clock_info[0].sclk = rdev->clock.default_sclk;
56278a8edacee9 Alex Deucher 2009-12-28 2799 rdev->pm.power_state[state_index].default_clock_mode =
56278a8edacee9 Alex Deucher 2009-12-28 2800 &rdev->pm.power_state[state_index].clock_info[0];
56278a8edacee9 Alex Deucher 2009-12-28 2801 rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE;
79daedc942813c Alex Deucher 2010-04-22 2802 rdev->pm.power_state[state_index].pcie_lanes = 16;
a48b9b4edb8bb8 Alex Deucher 2010-04-22 2803 rdev->pm.default_power_state_index = state_index;
a48b9b4edb8bb8 Alex Deucher 2010-04-22 2804 rdev->pm.power_state[state_index].flags = 0;
56278a8edacee9 Alex Deucher 2009-12-28 2805 state_index++;
56278a8edacee9 Alex Deucher 2009-12-28 2806 }
0975b16274bad1 Alex Deucher 2011-02-02 2807 }
8f3f1c9a22a642 Alex Deucher 2011-11-04 2808 }
02b17cc05372ab Alex Deucher 2010-04-22 2809
56278a8edacee9 Alex Deucher 2009-12-28 2810 rdev->pm.num_power_states = state_index;
771fe6b912fca5 Jerome Glisse 2009-06-05 2811
a48b9b4edb8bb8 Alex Deucher 2010-04-22 2812 rdev->pm.current_power_state_index = rdev->pm.default_power_state_index;
a48b9b4edb8bb8 Alex Deucher 2010-04-22 2813 rdev->pm.current_clock_mode_index = 0;
4376eee92e5a83 Alexander Müller 2011-12-30 2814 if (rdev->pm.default_power_state_index >= 0)
4376eee92e5a83 Alexander Müller 2011-12-30 2815 rdev->pm.current_vddc =
4376eee92e5a83 Alexander Müller 2011-12-30 @2816 rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
4376eee92e5a83 Alexander Müller 2011-12-30 2817 else
4376eee92e5a83 Alexander Müller 2011-12-30 2818 rdev->pm.current_vddc = 0;
56278a8edacee9 Alex Deucher 2009-12-28 2819 }
56278a8edacee9 Alex Deucher 2009-12-28 2820
:::::: The code at line 2816 was first introduced by commit
:::::: 4376eee92e5a8332b470040e672ea99cd44c826a drm/radeon/kms/atom: fix possible segfault in pm setup
:::::: TO: Alexander Müller <serveralex(a)gmail.com>
:::::: CC: Dave Airlie <airlied(a)redhat.com>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 months
drivers/dma/at_xdmac.c:1575:4: warning: Value stored to 'desc' 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: Xiaomeng Tong <xiam0nd.tong(a)gmail.com>
CC: Vinod Koul <vkoul(a)kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8013d1d3d2e33236dee13a133fba49ad55045e79
commit: 206680c4e46b62fd8909385e0874a36952595b85 dma: at_xdmac: fix a missing check on list iterator
date: 3 weeks ago
:::::: branch date: 12 hours ago
:::::: commit date: 3 weeks ago
config: arm-randconfig-c002-20220429 (https://download.01.org/0day-ci/archive/20220430/202204301828.uq1KLbC8-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 400775649969b9baf3bc2a510266e7912bb16ae9)
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 206680c4e46b62fd8909385e0874a36952595b85
# 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 >>)
^
drivers/dma/at_xdmac.c:1303:2: note: Taking false branch
dev_dbg(chan2dev(chan), "%s: sg_len=%d, value=0x%x, flags=0x%lx\n",
^
include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
if (0) \
^
drivers/dma/at_xdmac.c:1307:31: note: Assuming 'i' is < 'sg_len'
for_each_sg(sgl, sg, sg_len, i) {
^
include/linux/scatterlist.h:169:31: note: expanded from macro 'for_each_sg'
for (__i = 0, sg = (sglist); __i < (nr); __i++, sg = sg_next(sg))
^~~~~~~~~~
drivers/dma/at_xdmac.c:1307:2: note: Loop condition is true. Entering loop body
for_each_sg(sgl, sg, sg_len, i) {
^
include/linux/scatterlist.h:169:2: note: expanded from macro 'for_each_sg'
for (__i = 0, sg = (sglist); __i < (nr); __i++, sg = sg_next(sg))
^
drivers/dma/at_xdmac.c:1308:3: note: Taking false branch
dev_dbg(chan2dev(chan), "%s: dest=%pad, len=%d, pattern=0x%x, flags=0x%lx\n",
^
include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
if (0) \
^
drivers/dma/at_xdmac.c:1315:8: note: 'desc' is null
if (!desc && first)
^~~~
drivers/dma/at_xdmac.c:1315:7: note: Left side of '&&' is true
if (!desc && first)
^
drivers/dma/at_xdmac.c:1315:16: note: 'first' is null
if (!desc && first)
^~~~~
drivers/dma/at_xdmac.c:1315:3: note: Taking false branch
if (!desc && first)
^
drivers/dma/at_xdmac.c:1319:8: note: 'first' is null
if (!first)
^~~~~
drivers/dma/at_xdmac.c:1319:3: note: Taking true branch
if (!first)
^
drivers/dma/at_xdmac.c:1324:7: note: 'psg' is null
if (psg)
^~~
drivers/dma/at_xdmac.c:1324:3: note: Taking false branch
if (psg)
^
drivers/dma/at_xdmac.c:1347:7: note: 'ppdesc' is null
if (ppdesc && pdesc) {
^~~~~~
drivers/dma/at_xdmac.c:1347:14: note: Left side of '&&' is false
if (ppdesc && pdesc) {
^
drivers/dma/at_xdmac.c:1411:8: note: Assuming the condition is true
if ((i == (sg_len - 1)) &&
^~~~~~~~~~~~~~~~~
drivers/dma/at_xdmac.c:1411:7: note: Left side of '&&' is true
if ((i == (sg_len - 1)) &&
^
drivers/dma/at_xdmac.c:1412:7: note: Access to field 'length' results in a dereference of a null pointer (loaded from variable 'psg')
sg_dma_len(psg) == sg_dma_len(sg)) {
^
include/linux/scatterlist.h:33:25: note: expanded from macro 'sg_dma_len'
#define sg_dma_len(sg) ((sg)->length)
^ ~~
drivers/dma/at_xdmac.c:1443:28: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
first->tx_dma_desc.cookie = -EBUSY;
~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
drivers/dma/at_xdmac.c:1295:22: note: 'first' initialized to a null pointer value
*ppdesc = NULL, *first = NULL;
^~~~~
drivers/dma/at_xdmac.c:1300:6: note: Assuming 'sgl' is non-null
if (!sgl)
^~~~
drivers/dma/at_xdmac.c:1300:2: note: Taking false branch
if (!sgl)
^
drivers/dma/at_xdmac.c:1303:2: note: Taking false branch
dev_dbg(chan2dev(chan), "%s: sg_len=%d, value=0x%x, flags=0x%lx\n",
^
include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
if (0) \
^
drivers/dma/at_xdmac.c:1307:31: note: Assuming 'i' is >= 'sg_len'
for_each_sg(sgl, sg, sg_len, i) {
^
include/linux/scatterlist.h:169:31: note: expanded from macro 'for_each_sg'
for (__i = 0, sg = (sglist); __i < (nr); __i++, sg = sg_next(sg))
^~~~~~~~~~
drivers/dma/at_xdmac.c:1307:2: note: Loop condition is false. Execution continues on line 1443
for_each_sg(sgl, sg, sg_len, i) {
^
include/linux/scatterlist.h:169:2: note: expanded from macro 'for_each_sg'
for (__i = 0, sg = (sglist); __i < (nr); __i++, sg = sg_next(sg))
^
drivers/dma/at_xdmac.c:1443:28: note: Dereference of null pointer
first->tx_dma_desc.cookie = -EBUSY;
~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
>> drivers/dma/at_xdmac.c:1575:4: warning: Value stored to 'desc' is never read [clang-analyzer-deadcode.DeadStores]
desc = iter;
^ ~~~~
drivers/dma/at_xdmac.c:1575:4: note: Value stored to 'desc' is never read
desc = iter;
^ ~~~~
drivers/dma/at_xdmac.c:1654:2: warning: Value stored to 'bad_desc' is never read [clang-analyzer-deadcode.DeadStores]
bad_desc = list_first_entry(&atchan->xfers_list,
^
drivers/dma/at_xdmac.c:1654:2: note: Value stored to 'bad_desc' is never read
include/linux/list.h:292:9: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
return READ_ONCE(head->next) == head;
^
include/asm-generic/rwonce.h:50:2: note: expanded from macro 'READ_ONCE'
__READ_ONCE(x); \
^
include/asm-generic/rwonce.h:44:24: note: expanded from macro '__READ_ONCE'
#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
^
drivers/dma/at_xdmac.c:1000:38: note: 'first' initialized to a null pointer value
struct at_xdmac_desc *prev = NULL, *first = NULL;
^~~~~
drivers/dma/at_xdmac.c:1006:6: note: Assuming 'xt' is non-null
if (!xt || !xt->numf || (xt->dir != DMA_MEM_TO_MEM))
^~~
drivers/dma/at_xdmac.c:1006:6: note: Left side of '||' is false
drivers/dma/at_xdmac.c:1006:13: note: Assuming field 'numf' is not equal to 0
if (!xt || !xt->numf || (xt->dir != DMA_MEM_TO_MEM))
^~~~~~~~~
drivers/dma/at_xdmac.c:1006:6: note: Left side of '||' is false
if (!xt || !xt->numf || (xt->dir != DMA_MEM_TO_MEM))
^
drivers/dma/at_xdmac.c:1006:27: note: Assuming field 'dir' is equal to DMA_MEM_TO_MEM
if (!xt || !xt->numf || (xt->dir != DMA_MEM_TO_MEM))
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/at_xdmac.c:1006:2: note: Taking false branch
if (!xt || !xt->numf || (xt->dir != DMA_MEM_TO_MEM))
^
drivers/dma/at_xdmac.c:1013:7: note: Assuming field 'numf' is <= 1
if ((xt->numf > 1) && (xt->frame_size > 1))
^~~~~~~~~~~~
drivers/dma/at_xdmac.c:1013:21: note: Left side of '&&' is false
if ((xt->numf > 1) && (xt->frame_size > 1))
^
drivers/dma/at_xdmac.c:1016:2: note: Taking false branch
dev_dbg(chan2dev(chan), "%s: src=%pad, dest=%pad, numf=%zu, frame_size=%zu, flags=0x%lx\n",
^
include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
if (0) \
^
drivers/dma/at_xdmac.c:1023:10: note: Field 'numf' is <= 1
if (xt->numf > 1) {
^
drivers/dma/at_xdmac.c:1023:2: note: Taking false branch
if (xt->numf > 1) {
^
drivers/dma/at_xdmac.c:1037:15: note: Assuming 'i' is < field 'frame_size'
for (i = 0; i < xt->frame_size; i++) {
^~~~~~~~~~~~~~~~~~
drivers/dma/at_xdmac.c:1037:3: note: Loop condition is true. Entering loop body
for (i = 0; i < xt->frame_size; i++) {
^
drivers/dma/at_xdmac.c:1049:4: note: Taking false branch
dev_dbg(chan2dev(chan),
^
include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
if (0) \
^
drivers/dma/at_xdmac.c:1053:11: note: Calling 'at_xdmac_interleaved_queue_desc'
desc = at_xdmac_interleaved_queue_desc(chan, atchan,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/at_xdmac.c:933:6: note: Assuming the condition is true
if (chunk->size >= (AT_XDMAC_MBR_UBC_UBLEN_MAX << dwidth)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/at_xdmac.c:933:2: note: Taking true branch
if (chunk->size >= (AT_XDMAC_MBR_UBC_UBLEN_MAX << dwidth)) {
^
drivers/dma/at_xdmac.c:934:3: note: Taking false branch
dev_dbg(chan2dev(chan),
^
include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
if (0) \
^
drivers/dma/at_xdmac.c:938:3: note: Returning null pointer, which participates in a condition later
return NULL;
^~~~~~~~~~~
drivers/dma/at_xdmac.c:1053:11: note: Returning from 'at_xdmac_interleaved_queue_desc'
desc = at_xdmac_interleaved_queue_desc(chan, atchan,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/at_xdmac.c:1057:9: note: 'desc' is null
if (!desc) {
^~~~
drivers/dma/at_xdmac.c:1057:4: note: Taking true branch
if (!desc) {
^
drivers/dma/at_xdmac.c:1058:27: note: Passing null pointer value via 1st parameter 'list'
list_splice_tail_init(&first->descs_list,
^~~~~~~~~~~~~~~~~~
drivers/dma/at_xdmac.c:1058:5: note: Calling 'list_splice_tail_init'
list_splice_tail_init(&first->descs_list,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/desc +1575 drivers/dma/at_xdmac.c
67a6eedc4d2cc6 Maxime Ripard 2015-07-06 1449
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1450 static enum dma_status
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1451 at_xdmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1452 struct dma_tx_state *txstate)
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1453 {
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1454 struct at_xdmac_chan *atchan = to_at_xdmac_chan(chan);
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1455 struct at_xdmac *atxdmac = to_at_xdmac(atchan->chan.device);
206680c4e46b62 Xiaomeng Tong 2022-03-27 1456 struct at_xdmac_desc *desc, *_desc, *iter;
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1457 struct list_head *descs_list;
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1458 enum dma_status ret;
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1459 int residue, retry;
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1460 u32 cur_nda, check_nda, cur_ubc, mask, value;
be835074829b13 Ludovic Desroches 2015-01-27 1461 u8 dwidth = 0;
4c374fc7ce9440 Ludovic Desroches 2015-06-08 1462 unsigned long flags;
53398f488821c2 Ludovic Desroches 2016-05-12 1463 bool initd;
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1464
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1465 ret = dma_cookie_status(chan, cookie, txstate);
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1466 if (ret == DMA_COMPLETE)
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1467 return ret;
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1468
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1469 if (!txstate)
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1470 return ret;
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1471
4c374fc7ce9440 Ludovic Desroches 2015-06-08 1472 spin_lock_irqsave(&atchan->lock, flags);
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1473
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1474 desc = list_first_entry(&atchan->xfers_list, struct at_xdmac_desc, xfer_node);
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1475
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1476 /*
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1477 * If the transfer has not been started yet, don't need to compute the
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1478 * residue, it's the transfer length.
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1479 */
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1480 if (!desc->active_xfer) {
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1481 dma_set_residue(txstate, desc->xfer_size);
4c374fc7ce9440 Ludovic Desroches 2015-06-08 1482 goto spin_unlock;
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1483 }
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1484
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1485 residue = desc->xfer_size;
4e0978208d6773 Cyrille Pitchen 2014-11-13 1486 /*
4e0978208d6773 Cyrille Pitchen 2014-11-13 1487 * Flush FIFO: only relevant when the transfer is source peripheral
9295c41d77ca93 Ludovic Desroches 2016-05-12 1488 * synchronized. Flush is needed before reading CUBC because data in
9295c41d77ca93 Ludovic Desroches 2016-05-12 1489 * the FIFO are not reported by CUBC. Reporting a residue of the
9295c41d77ca93 Ludovic Desroches 2016-05-12 1490 * transfer length while we have data in FIFO can cause issue.
9295c41d77ca93 Ludovic Desroches 2016-05-12 1491 * Usecase: atmel USART has a timeout which means I have received
9295c41d77ca93 Ludovic Desroches 2016-05-12 1492 * characters but there is no more character received for a while. On
9295c41d77ca93 Ludovic Desroches 2016-05-12 1493 * timeout, it requests the residue. If the data are in the DMA FIFO,
9295c41d77ca93 Ludovic Desroches 2016-05-12 1494 * we will return a residue of the transfer length. It means no data
9295c41d77ca93 Ludovic Desroches 2016-05-12 1495 * received. If an application is waiting for these data, it will hang
9295c41d77ca93 Ludovic Desroches 2016-05-12 1496 * since we won't have another USART timeout without receiving new
9295c41d77ca93 Ludovic Desroches 2016-05-12 1497 * data.
4e0978208d6773 Cyrille Pitchen 2014-11-13 1498 */
4e0978208d6773 Cyrille Pitchen 2014-11-13 1499 mask = AT_XDMAC_CC_TYPE | AT_XDMAC_CC_DSYNC;
4e0978208d6773 Cyrille Pitchen 2014-11-13 1500 value = AT_XDMAC_CC_TYPE_PER_TRAN | AT_XDMAC_CC_DSYNC_PER2MEM;
be835074829b13 Ludovic Desroches 2015-01-27 1501 if ((desc->lld.mbr_cfg & mask) == value) {
2bec35a529b7d3 Eugen Hristev 2020-10-16 1502 at_xdmac_write(atxdmac, atxdmac->layout->gswf, atchan->mask);
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1503 while (!(at_xdmac_chan_read(atchan, AT_XDMAC_CIS) & AT_XDMAC_CIS_FIS))
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1504 cpu_relax();
4e0978208d6773 Cyrille Pitchen 2014-11-13 1505 }
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1506
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1507 /*
53398f488821c2 Ludovic Desroches 2016-05-12 1508 * The easiest way to compute the residue should be to pause the DMA
53398f488821c2 Ludovic Desroches 2016-05-12 1509 * but doing this can lead to miss some data as some devices don't
53398f488821c2 Ludovic Desroches 2016-05-12 1510 * have FIFO.
53398f488821c2 Ludovic Desroches 2016-05-12 1511 * We need to read several registers because:
53398f488821c2 Ludovic Desroches 2016-05-12 1512 * - DMA is running therefore a descriptor change is possible while
53398f488821c2 Ludovic Desroches 2016-05-12 1513 * reading these registers
53398f488821c2 Ludovic Desroches 2016-05-12 1514 * - When the block transfer is done, the value of the CUBC register
53398f488821c2 Ludovic Desroches 2016-05-12 1515 * is set to its initial value until the fetch of the next descriptor.
53398f488821c2 Ludovic Desroches 2016-05-12 1516 * This value will corrupt the residue calculation so we have to skip
53398f488821c2 Ludovic Desroches 2016-05-12 1517 * it.
53398f488821c2 Ludovic Desroches 2016-05-12 1518 *
53398f488821c2 Ludovic Desroches 2016-05-12 1519 * INITD -------- ------------
53398f488821c2 Ludovic Desroches 2016-05-12 1520 * |____________________|
53398f488821c2 Ludovic Desroches 2016-05-12 1521 * _______________________ _______________
53398f488821c2 Ludovic Desroches 2016-05-12 1522 * NDA @desc2 \/ @desc3
53398f488821c2 Ludovic Desroches 2016-05-12 1523 * _______________________/\_______________
53398f488821c2 Ludovic Desroches 2016-05-12 1524 * __________ ___________ _______________
53398f488821c2 Ludovic Desroches 2016-05-12 1525 * CUBC 0 \/ MAX desc1 \/ MAX desc2
53398f488821c2 Ludovic Desroches 2016-05-12 1526 * __________/\___________/\_______________
53398f488821c2 Ludovic Desroches 2016-05-12 1527 *
53398f488821c2 Ludovic Desroches 2016-05-12 1528 * Since descriptors are aligned on 64 bits, we can assume that
53398f488821c2 Ludovic Desroches 2016-05-12 1529 * the update of NDA and CUBC is atomic.
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1530 * Memory barriers are used to ensure the read order of the registers.
53398f488821c2 Ludovic Desroches 2016-05-12 1531 * A max number of retries is set because unlikely it could never ends.
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1532 */
53398f488821c2 Ludovic Desroches 2016-05-12 1533 for (retry = 0; retry < AT_XDMAC_RESIDUE_MAX_RETRIES; retry++) {
53398f488821c2 Ludovic Desroches 2016-05-12 1534 check_nda = at_xdmac_chan_read(atchan, AT_XDMAC_CNDA) & 0xfffffffc;
53398f488821c2 Ludovic Desroches 2016-05-12 1535 rmb();
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1536 cur_ubc = at_xdmac_chan_read(atchan, AT_XDMAC_CUBC);
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1537 rmb();
c5637476bbf9bb Maxime Jayat 2018-02-22 1538 initd = !!(at_xdmac_chan_read(atchan, AT_XDMAC_CC) & AT_XDMAC_CC_INITD);
c5637476bbf9bb Maxime Jayat 2018-02-22 1539 rmb();
53398f488821c2 Ludovic Desroches 2016-05-12 1540 cur_nda = at_xdmac_chan_read(atchan, AT_XDMAC_CNDA) & 0xfffffffc;
53398f488821c2 Ludovic Desroches 2016-05-12 1541 rmb();
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1542
53398f488821c2 Ludovic Desroches 2016-05-12 1543 if ((check_nda == cur_nda) && initd)
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1544 break;
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1545 }
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1546
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1547 if (unlikely(retry >= AT_XDMAC_RESIDUE_MAX_RETRIES)) {
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1548 ret = DMA_ERROR;
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1549 goto spin_unlock;
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1550 }
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1551
9295c41d77ca93 Ludovic Desroches 2016-05-12 1552 /*
9295c41d77ca93 Ludovic Desroches 2016-05-12 1553 * Flush FIFO: only relevant when the transfer is source peripheral
9295c41d77ca93 Ludovic Desroches 2016-05-12 1554 * synchronized. Another flush is needed here because CUBC is updated
9295c41d77ca93 Ludovic Desroches 2016-05-12 1555 * when the controller sends the data write command. It can lead to
9295c41d77ca93 Ludovic Desroches 2016-05-12 1556 * report data that are not written in the memory or the device. The
9295c41d77ca93 Ludovic Desroches 2016-05-12 1557 * FIFO flush ensures that data are really written.
9295c41d77ca93 Ludovic Desroches 2016-05-12 1558 */
9295c41d77ca93 Ludovic Desroches 2016-05-12 1559 if ((desc->lld.mbr_cfg & mask) == value) {
2bec35a529b7d3 Eugen Hristev 2020-10-16 1560 at_xdmac_write(atxdmac, atxdmac->layout->gswf, atchan->mask);
9295c41d77ca93 Ludovic Desroches 2016-05-12 1561 while (!(at_xdmac_chan_read(atchan, AT_XDMAC_CIS) & AT_XDMAC_CIS_FIS))
9295c41d77ca93 Ludovic Desroches 2016-05-12 1562 cpu_relax();
9295c41d77ca93 Ludovic Desroches 2016-05-12 1563 }
9295c41d77ca93 Ludovic Desroches 2016-05-12 1564
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1565 /*
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1566 * Remove size of all microblocks already transferred and the current
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1567 * one. Then add the remaining size to transfer of the current
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1568 * microblock.
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1569 */
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1570 descs_list = &desc->descs_list;
206680c4e46b62 Xiaomeng Tong 2022-03-27 1571 list_for_each_entry_safe(iter, _desc, descs_list, desc_node) {
206680c4e46b62 Xiaomeng Tong 2022-03-27 1572 dwidth = at_xdmac_get_dwidth(iter->lld.mbr_cfg);
206680c4e46b62 Xiaomeng Tong 2022-03-27 1573 residue -= (iter->lld.mbr_ubc & 0xffffff) << dwidth;
206680c4e46b62 Xiaomeng Tong 2022-03-27 1574 if ((iter->lld.mbr_nda & 0xfffffffc) == cur_nda) {
206680c4e46b62 Xiaomeng Tong 2022-03-27 @1575 desc = iter;
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1576 break;
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1577 }
206680c4e46b62 Xiaomeng Tong 2022-03-27 1578 }
25c5e9626ca4d4 Ludovic Desroches 2016-03-10 1579 residue += cur_ubc << dwidth;
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1580
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1581 dma_set_residue(txstate, residue);
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1582
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1583 dev_dbg(chan2dev(chan),
82e2424635f4c0 Vinod Koul 2014-11-06 1584 "%s: desc=0x%p, tx_dma_desc.phys=%pad, tx_status=%d, cookie=%d, residue=%d\n",
82e2424635f4c0 Vinod Koul 2014-11-06 1585 __func__, desc, &desc->tx_dma_desc.phys, ret, cookie, residue);
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1586
4c374fc7ce9440 Ludovic Desroches 2015-06-08 1587 spin_unlock:
4c374fc7ce9440 Ludovic Desroches 2015-06-08 1588 spin_unlock_irqrestore(&atchan->lock, flags);
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1589 return ret;
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1590 }
e1f7c9eee70730 Ludovic Desroches 2014-10-22 1591
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 months
kernel/irq/msi.c:555 msi_handle_pci_fail() warn: ignoring unreachable code.
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Thomas Gleixner <tglx(a)linutronix.de>
CC: Jason Gunthorpe <jgg(a)nvidia.com>
CC: "Greg Kroah-Hartman" <gregkh(a)linuxfoundation.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8013d1d3d2e33236dee13a133fba49ad55045e79
commit: 890337624e1fa2da079fc1c036a62d178c985280 genirq/msi: Handle PCI/MSI allocation fail in core code
date: 5 months ago
:::::: branch date: 11 hours ago
:::::: commit date: 5 months ago
config: arm64-randconfig-m031-20220427 (https://download.01.org/0day-ci/archive/20220430/202204301857.7soRGY44-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:
kernel/irq/msi.c:555 msi_handle_pci_fail() warn: ignoring unreachable code.
vim +555 kernel/irq/msi.c
da5dd9e854d2ed Thomas Gleixner 2017-12-29 540
890337624e1fa2 Thomas Gleixner 2021-12-06 541 static int msi_handle_pci_fail(struct irq_domain *domain, struct msi_desc *desc,
890337624e1fa2 Thomas Gleixner 2021-12-06 542 int allocated)
890337624e1fa2 Thomas Gleixner 2021-12-06 543 {
890337624e1fa2 Thomas Gleixner 2021-12-06 544 switch(domain->bus_token) {
890337624e1fa2 Thomas Gleixner 2021-12-06 545 case DOMAIN_BUS_PCI_MSI:
890337624e1fa2 Thomas Gleixner 2021-12-06 546 case DOMAIN_BUS_VMD_MSI:
890337624e1fa2 Thomas Gleixner 2021-12-06 547 if (IS_ENABLED(CONFIG_PCI_MSI))
890337624e1fa2 Thomas Gleixner 2021-12-06 548 break;
890337624e1fa2 Thomas Gleixner 2021-12-06 549 fallthrough;
890337624e1fa2 Thomas Gleixner 2021-12-06 550 default:
890337624e1fa2 Thomas Gleixner 2021-12-06 551 return -ENOSPC;
890337624e1fa2 Thomas Gleixner 2021-12-06 552 }
890337624e1fa2 Thomas Gleixner 2021-12-06 553
890337624e1fa2 Thomas Gleixner 2021-12-06 554 /* Let a failed PCI multi MSI allocation retry */
890337624e1fa2 Thomas Gleixner 2021-12-06 @555 if (desc->nvec_used > 1)
890337624e1fa2 Thomas Gleixner 2021-12-06 556 return 1;
890337624e1fa2 Thomas Gleixner 2021-12-06 557
890337624e1fa2 Thomas Gleixner 2021-12-06 558 /* If there was a successful allocation let the caller know */
890337624e1fa2 Thomas Gleixner 2021-12-06 559 return allocated ? allocated : -ENOSPC;
890337624e1fa2 Thomas Gleixner 2021-12-06 560 }
890337624e1fa2 Thomas Gleixner 2021-12-06 561
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 months
[djwong-xfs:vectorized-scrub 309/399] fs/xfs/libxfs/xfs_rmap.c:2558:20: warning: Parameter 'pag' can be declared with const [constParameter]
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: "Darrick J. Wong" <darrick.wong(a)oracle.com>
CC: linux-kernel(a)vger.kernel.org
TO: "Darrick J. Wong" <djwong(a)kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git vectorized-scrub
head: afeb4fa123e9a46cb653baab2baa3259c051f7d7
commit: 0c235943d6a275a48ce6fbe16f6b43ad60058869 [309/399] xfs: wire up rmap map and unmap to the realtime rmapbt
:::::: branch date: 11 hours ago
:::::: commit date: 11 hours ago
compiler: mips64-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
# apt-get install cppcheck
git checkout 0c235943d6a275a48ce6fbe16f6b43ad60058869
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)
>> fs/xfs/libxfs/xfs_rmap.c:2558:20: warning: Parameter 'pag' can be declared with const [constParameter]
struct xfs_perag *pag)
^
fs/xfs/libxfs/xfs_rmap.c:2679:25: warning: Parameter 'bmap' can be declared with const [constParameter]
struct xfs_bmbt_irec *bmap)
^
vim +/pag +2558 fs/xfs/libxfs/xfs_rmap.c
0d82b5c4a91112 Darrick J. Wong 2022-01-06 2553
0c235943d6a275 Darrick J. Wong 2022-01-06 2554 /* Does this btree cursor match the given AG? */
0c235943d6a275 Darrick J. Wong 2022-01-06 2555 static inline bool
0c235943d6a275 Darrick J. Wong 2022-01-06 2556 xfs_rmap_is_wrong_cursor(
0c235943d6a275 Darrick J. Wong 2022-01-06 2557 struct xfs_btree_cur *cur,
0c235943d6a275 Darrick J. Wong 2022-01-06 @2558 struct xfs_perag *pag)
0c235943d6a275 Darrick J. Wong 2022-01-06 2559 {
0c235943d6a275 Darrick J. Wong 2022-01-06 2560 if (!pag) {
0c235943d6a275 Darrick J. Wong 2022-01-06 2561 /* finishing a realtime rmap */
0c235943d6a275 Darrick J. Wong 2022-01-06 2562 return cur->bc_btnum != XFS_BTNUM_RTRMAP;
0c235943d6a275 Darrick J. Wong 2022-01-06 2563 }
0c235943d6a275 Darrick J. Wong 2022-01-06 2564
0c235943d6a275 Darrick J. Wong 2022-01-06 2565 return cur->bc_ag.pag != pag;
0c235943d6a275 Darrick J. Wong 2022-01-06 2566 }
0c235943d6a275 Darrick J. Wong 2022-01-06 2567
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 months
[djwong-xfs:report-refcounts 400/400] fs/xfs/libxfs/xfs_refcount.c:1960:28: warning: Parameter 'low_rec' can be declared with const [constParameter]
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: "Darrick J. Wong" <darrick.wong(a)oracle.com>
CC: linux-kernel(a)vger.kernel.org
TO: "Darrick J. Wong" <djwong(a)kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git report-refcounts
head: 0ba96363d9c626afec1bcac75f71e5914adae2a9
commit: 0ba96363d9c626afec1bcac75f71e5914adae2a9 [400/400] xfs: export reference count information to userspace
:::::: branch date: 10 hours ago
:::::: commit date: 10 hours ago
compiler: microblaze-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
# apt-get install cppcheck
git checkout 0ba96363d9c626afec1bcac75f71e5914adae2a9
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 warnings: (new ones prefixed by >>)
>> fs/xfs/xfs_qm_syscalls.c:412:2: warning: Redundant assignment of 'dqp' to itself. [selfAssignment]
xfs_qm_dqrele(dqp);
^
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> fs/xfs/libxfs/xfs_refcount.c:1960:28: warning: Parameter 'low_rec' can be declared with const [constParameter]
struct xfs_refcount_irec *low_rec,
^
>> fs/xfs/libxfs/xfs_refcount.c:1961:28: warning: Parameter 'high_rec' can be declared with const [constParameter]
struct xfs_refcount_irec *high_rec,
^
>> fs/xfs/libxfs/xfs_refcount.c:1216:20: warning: Parameter 'pag' can be declared with const [constParameter]
struct xfs_perag *pag)
^
vim +/low_rec +1960 fs/xfs/libxfs/xfs_refcount.c
0ba96363d9c626 Darrick J. Wong 2022-01-06 1955
0ba96363d9c626 Darrick J. Wong 2022-01-06 1956 /* Find all refcount records between two keys. */
0ba96363d9c626 Darrick J. Wong 2022-01-06 1957 int
0ba96363d9c626 Darrick J. Wong 2022-01-06 1958 xfs_refcount_query_range(
0ba96363d9c626 Darrick J. Wong 2022-01-06 1959 struct xfs_btree_cur *cur,
0ba96363d9c626 Darrick J. Wong 2022-01-06 @1960 struct xfs_refcount_irec *low_rec,
0ba96363d9c626 Darrick J. Wong 2022-01-06 @1961 struct xfs_refcount_irec *high_rec,
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 months
[djwong-xfs:vectorized-scrub 293/399] fs/xfs/libxfs/xfs_rmap.c:2609:25: warning: Parameter 'bmap' can be declared with const [constParameter]
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: "Darrick J. Wong" <darrick.wong(a)oracle.com>
CC: linux-kernel(a)vger.kernel.org
TO: "Darrick J. Wong" <djwong(a)kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git vectorized-scrub
head: afeb4fa123e9a46cb653baab2baa3259c051f7d7
commit: 502ebc43eaea6e55ac3e1f3b97e10cb0c1c2d655 [293/399] xfs: clean up rmap log intent item tracepoint callsites
:::::: branch date: 9 hours ago
:::::: commit date: 9 hours ago
compiler: mips64-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
# apt-get install cppcheck
git checkout 502ebc43eaea6e55ac3e1f3b97e10cb0c1c2d655
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)
>> fs/xfs/libxfs/xfs_rmap.c:2609:25: warning: Parameter 'bmap' can be declared with const [constParameter]
struct xfs_bmbt_irec *bmap)
^
vim +/bmap +2609 fs/xfs/libxfs/xfs_rmap.c
9c19464469556a Darrick J. Wong 2016-08-03 2598
9c19464469556a Darrick J. Wong 2016-08-03 2599 /*
9c19464469556a Darrick J. Wong 2016-08-03 2600 * Record a rmap intent; the list is kept sorted first by AG and then by
9c19464469556a Darrick J. Wong 2016-08-03 2601 * increasing age.
9c19464469556a Darrick J. Wong 2016-08-03 2602 */
bc46ac64713f11 Darrick J. Wong 2019-08-26 2603 static void
9c19464469556a Darrick J. Wong 2016-08-03 2604 __xfs_rmap_add(
0f37d1780c3d86 Brian Foster 2018-08-01 2605 struct xfs_trans *tp,
9c19464469556a Darrick J. Wong 2016-08-03 2606 enum xfs_rmap_intent_type type,
c8ce540db5f67d Darrick J. Wong 2017-06-16 2607 uint64_t owner,
9c19464469556a Darrick J. Wong 2016-08-03 2608 int whichfork,
9c19464469556a Darrick J. Wong 2016-08-03 @2609 struct xfs_bmbt_irec *bmap)
9c19464469556a Darrick J. Wong 2016-08-03 2610 {
9c19464469556a Darrick J. Wong 2016-08-03 2611 struct xfs_rmap_intent *ri;
9c19464469556a Darrick J. Wong 2016-08-03 2612
f3c799c22c661e Darrick J. Wong 2021-10-12 2613 ri = kmem_cache_alloc(xfs_rmap_intent_cache, GFP_NOFS | __GFP_NOFAIL);
9c19464469556a Darrick J. Wong 2016-08-03 2614 INIT_LIST_HEAD(&ri->ri_list);
9c19464469556a Darrick J. Wong 2016-08-03 2615 ri->ri_type = type;
9c19464469556a Darrick J. Wong 2016-08-03 2616 ri->ri_owner = owner;
9c19464469556a Darrick J. Wong 2016-08-03 2617 ri->ri_whichfork = whichfork;
9c19464469556a Darrick J. Wong 2016-08-03 2618 ri->ri_bmap = *bmap;
9c19464469556a Darrick J. Wong 2016-08-03 2619
502ebc43eaea6e Darrick J. Wong 2022-01-06 2620 trace_xfs_rmap_defer(tp->t_mountp, ri);
0f37d1780c3d86 Brian Foster 2018-08-01 2621 xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_RMAP, &ri->ri_list);
9c19464469556a Darrick J. Wong 2016-08-03 2622 }
9c19464469556a Darrick J. Wong 2016-08-03 2623
:::::: The code at line 2609 was first introduced by commit
:::::: 9c19464469556a0cd342fc40a24926ab46d7d243 xfs: propagate bmap updates to rmapbt
:::::: TO: Darrick J. Wong <darrick.wong(a)oracle.com>
:::::: CC: Dave Chinner <david(a)fromorbit.com>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
2 months