tree:   https://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git 
no-dma-compile-testing-v2
head:   2f66c3ff5625a968fe87b2dc0fb74eb8ca31bc40
commit: e1304a3d5b8cd7c476d5e8834482f0056f58b316 [25/26] staging: 
vc04_services: Remove depends on HAS_DMA in case of platform dependency
config: cris-allyesconfig (attached as .config)
compiler: cris-linux-gcc (GCC) 7.2.0
reproduce:
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout e1304a3d5b8cd7c476d5e8834482f0056f58b316
        # save the attached .config to linux build tree
        make.cross ARCH=cris 

All warnings (new ones prefixed by >>):

   drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c: In 
function 'vchiq_complete_bulk':
>> drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c:610:4: 
>> warning: argument 2 null where non-null expected [-Wnonnull]
       memcpy((char *)kmap(pages[0]) +
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        pagelist->offset,
        ~~~~~~~~~~~~~~~~~
        fragments,
        ~~~~~~~~~~
        head_bytes);
        ~~~~~~~~~~~
   In file included from include/linux/string.h:20:0,
                    from include/linux/bitmap.h:9,
                    from include/linux/cpumask.h:12,
                    from include/linux/interrupt.h:10,
                    from 
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c:37:
   arch/cris/include/asm/string.h:8:14: note: in a call to function 'memcpy' 
declared here
    extern void *memcpy(void *, const void *, size_t);
                 ^~~~~~

vim +610 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c

71bad7f08 popcornmix           2013-07-02  574  
71bad7f08 popcornmix           2013-07-02  575  static void
4807f2c0e Michael Zoran        2016-11-07  576  free_pagelist(struct 
vchiq_pagelist_info *pagelistinfo,
4807f2c0e Michael Zoran        2016-11-07  577                int actual)
71bad7f08 popcornmix           2013-07-02  578  {
4807f2c0e Michael Zoran        2016-11-07  579          PAGELIST_T *pagelist   
= pagelistinfo->pagelist;
4807f2c0e Michael Zoran        2016-11-07  580          struct page **pages    
= pagelistinfo->pages;
4807f2c0e Michael Zoran        2016-11-07  581          unsigned int num_pages 
= pagelistinfo->num_pages;
71bad7f08 popcornmix           2013-07-02  582  
df044ebfc Greg Kroah-Hartman   2016-10-10  583          
vchiq_log_trace(vchiq_arm_log_level, "free_pagelist - %pK, %d",
4807f2c0e Michael Zoran        2016-11-07  584                          
pagelistinfo->pagelist, actual);
cf9caf192 Michael Zoran        2016-10-25  585  
4807f2c0e Michael Zoran        2016-11-07  586          /*
4807f2c0e Michael Zoran        2016-11-07  587           * NOTE: dma_unmap_sg 
must be called before the
4807f2c0e Michael Zoran        2016-11-07  588           * cpu can touch any of 
the data/pages.
4807f2c0e Michael Zoran        2016-11-07  589           */
4807f2c0e Michael Zoran        2016-11-07  590          dma_unmap_sg(g_dev, 
pagelistinfo->scatterlist,
4807f2c0e Michael Zoran        2016-11-07  591                       
pagelistinfo->num_pages, pagelistinfo->dma_dir);
4807f2c0e Michael Zoran        2016-11-07  592          
pagelistinfo->scatterlist_mapped = 0;
71bad7f08 popcornmix           2013-07-02  593  
71bad7f08 popcornmix           2013-07-02  594          /* Deal with any 
partial cache lines (fragments) */
71bad7f08 popcornmix           2013-07-02  595          if (pagelist->type >= 
PAGELIST_READ_WITH_FRAGMENTS) {
71bad7f08 popcornmix           2013-07-02  596                  char *fragments 
= g_fragments_base +
71bad7f08 popcornmix           2013-07-02  597                          
(pagelist->type - PAGELIST_READ_WITH_FRAGMENTS) *
71bad7f08 popcornmix           2013-07-02  598                          
g_fragments_size;
71bad7f08 popcornmix           2013-07-02  599                  int head_bytes, 
tail_bytes;
6e475350a Yamanappagouda Patil 2017-02-21  600  
71bad7f08 popcornmix           2013-07-02  601                  head_bytes = 
(g_cache_line_size - pagelist->offset) &
71bad7f08 popcornmix           2013-07-02  602                          
(g_cache_line_size - 1);
71bad7f08 popcornmix           2013-07-02  603                  tail_bytes = 
(pagelist->offset + actual) &
71bad7f08 popcornmix           2013-07-02  604                          
(g_cache_line_size - 1);
71bad7f08 popcornmix           2013-07-02  605  
71bad7f08 popcornmix           2013-07-02  606                  if ((actual >= 
0) && (head_bytes != 0)) {
71bad7f08 popcornmix           2013-07-02  607                          if 
(head_bytes > actual)
71bad7f08 popcornmix           2013-07-02  608                                  
head_bytes = actual;
71bad7f08 popcornmix           2013-07-02  609  
974d4d03f Stefan Wahren        2017-09-03 @610                          
memcpy((char *)kmap(pages[0]) +

:::::: The code at line 610 was first introduced by commit
:::::: 974d4d03fc020af4fa4e9e72a86f0fefa37803c5 staging: vchiq_2835_arm: Fix 
NULL ptr dereference in free_pagelist

:::::: TO: Stefan Wahren <stefan.wah...@i2se.com>
:::::: CC: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to