An error occurred while fetching folder content.
kasan: avoid -Wmaybe-uninitialized warning
Arnd Bergmann authored
commit e7701557 upstream.

gcc-7 produces this warning:

  mm/kasan/report.c: In function 'kasan_report':
  mm/kasan/report.c:351:3: error: 'info.first_bad_addr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     print_shadow_for_address(info->first_bad_addr);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  mm/kasan/report.c:360:27: note: 'info.first_bad_addr' was declared here

The code seems fine as we only print info.first_bad_addr when there is a
shadow, and we always initialize it in that case, but this is relatively
hard for gcc to figure out after the latest rework.

Adding an intialization to the most likely value together with the other
struct members shuts up that warning.

Fixes: b235b9808664 ("kasan: unify report headers")
Link: https://patchwork.kernel.org/patch/9641417/
Link: http://lkml.kernel.org/r/20170725152739.4176967-1-arnd@arndb.de

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Su...
30ca85a5
Name Last commit Last update
..
kasan kasan: avoid -Wmaybe-uninitialized warning
Kconfig mm: don't allow deferred pages with NEED_PER_CPU_KM
Kconfig.debug PM / Hibernate: allow hibernation with PAGE_POISONING_ZERO
Makefile Disable the __builtin_return_address() warning globally after all
backing-dev.c block: fix double-free in the failure path of cgwb_bdi_init()
balloon_compaction.c mm: balloon: use general non-lru movable page feature
bootmem.c mm: kmemleak: avoid using __va() on addresses that don't have a lowmem mapping
cleancache.c cleancache: constify cleancache_ops structure
cma.c mm/cma.c: cma_declare_contiguous: correct err handling
cma.h mm: cma: mark cma_bitmap_maxno() inline in header
cma_debug.c mm/cma_debug: correct size input to bitmap function
compaction.c mm, compaction: fix NR_ISOLATED_* stats for pfn based migration
debug.c mm: get rid of vmacache_flush_all() entirely
debug_page_ref.c mm/page_ref: add tracepoint to track down page reference manipulation
dmapool.c mm: convert printk(KERN_<LEVEL> to pr_<level>
early_ioremap.c mm/early_ioremap: Fix boot hang with earlyprintk=efi,keep
fadvise.c mm/fadvise.c: fix signed overflow UBSAN complaint
failslab.c mm: fault-inject take over bootstrap kmem_cache check
filemap.c mm/filemap.c: fix NULL pointer in page_cache_tree_insert()
frame_vector.c mm/frame_vector.c: release a semaphore in 'get_vaddr_frames()'
frontswap.c mm, frontswap: convert frontswap_enabled to static key
gup.c mm/gup: fix gup_pmd_range() for dax
highmem.c mm/highmem: make nr_free_highpages() handles all highmem zones by itself
huge_memory.c mm/huge_memory: fix lockdep complaint on 32-bit i_size_read()
hugetlb.c hugetlbfs: fix races and page leaks during migration
hugetlb_cgroup.c
hwpoison-inject.c
init-mm.c
internal.h
interval_tree.c
khugepaged.c
kmemcheck.c
kmemleak-test.c
kmemleak.c
ksm.c
list_lru.c
maccess.c
madvise.c
memblock.c
memcontrol.c
memory-failure.c
memory.c
memory_hotplug.c
mempolicy.c
mempool.c
memtest.c
migrate.c
mincore.c
mlock.c
mm_init.c
mmap.c
mmu_context.c
mmu_notifier.c
mmzone.c
mprotect.c
mremap.c
msync.c
nobootmem.c
nommu.c
oom_kill.c
page-writeback.c
page_alloc.c
page_counter.c
page_ext.c
page_idle.c
page_io.c
page_isolation.c
page_owner.c
page_poison.c
pagewalk.c
percpu-km.c
percpu-vm.c
percpu.c
pgtable-generic.c
process_vm_access.c
quicklist.c
readahead.c
rmap.c
shmem.c
slab.c
slab.h
slab_common.c
slob.c
slub.c
sparse-vmemmap.c
sparse.c
swap.c
swap_cgroup.c
swap_state.c
swapfile.c
truncate.c
usercopy.c
userfaultfd.c
util.c
vmacache.c
vmalloc.c
vmpressure.c
vmscan.c
vmstat.c
workingset.c