:::::: 
:::::: Manual check reason: "low confidence bisect report"
:::::: Manual check reason: "low confidence static check warning: 
drivers/media/i2c/ov5693.c:518:13: warning: use of uninitialized value 
'<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]"
:::::: 

CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Daniel Scally <[email protected]>
CC: Mauro Carvalho Chehab <[email protected]>
CC: [email protected]
CC: "Jean-Michel Hautbois" <[email protected]>
CC: Sakari Ailus <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   af2c9ac24019ece9281e606662e5c78fa67f5930
commit: 89aef879cb537061f7a0948210fc00c5f1b5dfb4 media: i2c: Add support for 
ov5693 sensor
date:   8 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 8 months ago
config: arm-randconfig-c002-20220718 
(https://download.01.org/0day-ci/archive/20220725/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=89aef879cb537061f7a0948210fc00c5f1b5dfb4
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 89aef879cb537061f7a0948210fc00c5f1b5dfb4
        # save the config file
         ARCH=arm KBUILD_USERCFLAGS='-fanalyzer -Wno-error' 

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>

gcc-analyzer warnings: (new ones prefixed by >>)
   drivers/media/i2c/ov5693.c: In function 'ov5693_get_exposure':
>> drivers/media/i2c/ov5693.c:518:13: warning: use of uninitialized value 
>> '<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
     518 |         u32 exposure;
         |             ^~~~~~~~
     'ov5693_get_exposure': event 1
       |
       |  518 |         u32 exposure;
       |      |             ^~~~~~~~
       |      |             |
       |      |             (1) use of uninitialized value '<unknown>' here
       |
   drivers/media/i2c/ov5693.c: In function 'ov5693_get_gain':
   drivers/media/i2c/ov5693.c:545:13: warning: use of uninitialized value 
'<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
     545 |         u32 value;
         |             ^~~~~
     'ov5693_get_gain': event 1
       |
       |  545 |         u32 value;
       |      |             ^~~~~
       |      |             |
       |      |             (1) use of uninitialized value '<unknown>' here
       |
   drivers/media/i2c/ov5693.c: In function 'ov5693_detect':
   drivers/media/i2c/ov5693.c:871:13: warning: use of uninitialized value 
'<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
     871 |         u32 id;
         |             ^~
     'ov5693_detect': event 1
       |
       |  871 |         u32 id;
       |      |             ^~
       |      |             |
       |      |             (1) use of uninitialized value '<unknown>' here
       |
   In file included from include/linux/kernel.h:17,
                    from include/linux/unaligned/packed_struct.h:4,
                    from include/asm-generic/unaligned.h:9,
                    from ./arch/arm/include/generated/asm/unaligned.h:1,
                    from drivers/media/i2c/ov5693.c:15:
   drivers/media/i2c/ov5693.c: In function 'ov5693_set_fmt':
   include/linux/compiler-gcc.h:42:45: warning: dereference of NULL 'crop' 
[CWE-476] [-Wanalyzer-null-dereference]
      42 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), 
__COUNTER__)
         |                                             ^~~~~~~~~~~~
   include/linux/minmax.h:32:27: note: in definition of macro '__cmp_once'
      32 |                 typeof(y) unique_y = (y);               \
         |                           ^~~~~~~~
   include/linux/compiler_types.h:60:22: note: in expansion of macro '___PASTE'
      60 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^~~~~~~~
   include/linux/compiler-gcc.h:42:29: note: in expansion of macro '__PASTE'
      42 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), 
__COUNTER__)
         |                             ^~~~~~~
   include/linux/compiler_types.h:60:22: note: in expansion of macro '___PASTE'
      60 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^~~~~~~~
   include/linux/compiler-gcc.h:42:37: note: in expansion of macro '__PASTE'
      42 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), 
__COUNTER__)
         |                                     ^~~~~~~
   include/linux/minmax.h:38:52: note: in expansion of macro '__UNIQUE_ID'
      38 |                 __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), 
op))
         |                                                    ^~~~~~~~~~~
   include/linux/minmax.h:104:33: note: in expansion of macro '__careful_cmp'
     104 | #define min_t(type, x, y)       __careful_cmp((type)(x), (type)(y), 
<)
         |                                 ^~~~~~~~~~~~~
   include/linux/minmax.h:124:36: note: in expansion of macro 'min_t'
     124 | #define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), 
hi)
         |                                    ^~~~~
   drivers/media/i2c/ov5693.c:961:17: note: in expansion of macro 'clamp_t'
     961 |         width = clamp_t(unsigned int, ALIGN(format->format.width, 2),
         |                 ^~~~~~~
     'ov5693_set_fmt': events 1-2
       |
       |  942 | static int ov5693_set_fmt(struct v4l2_subdev *sd,
       |      |            ^~~~~~~~~~~~~~
       |      |            |
       |      |            (1) entry to 'ov5693_set_fmt'
       |......
       |  955 |         crop = __ov5693_get_pad_crop(ov5693, state, 
format->pad, format->which);
       |      |                
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |      |                |
       |      |                (2) calling '__ov5693_get_pad_crop' from 
'ov5693_set_fmt'
       |
       +--> '__ov5693_get_pad_crop': events 3-4
              |
              |  917 | __ov5693_get_pad_crop(struct ov5693_device *ov5693,
              |      | ^~~~~~~~~~~~~~~~~~~~~
              |      | |
              |      | (3) entry to '__ov5693_get_pad_crop'
              |......
              |  921 |         switch (which) {
              |      |         ~~~~~~
              |      |         |
              |      |         (4) following 'default:' branch...
              |
            '__ov5693_get_pad_crop': event 5
              |
              |cc1:
              | (5): ...to here
              |
       <------+
       |
     'ov5693_set_fmt': event 6
       |

vim +518 drivers/media/i2c/ov5693.c

89aef879cb5370 Daniel Scally 2021-11-23  515  
89aef879cb5370 Daniel Scally 2021-11-23  516  static int 
ov5693_get_exposure(struct ov5693_device *ov5693, s32 *value)
89aef879cb5370 Daniel Scally 2021-11-23  517  {
89aef879cb5370 Daniel Scally 2021-11-23 @518    u32 exposure;
89aef879cb5370 Daniel Scally 2021-11-23  519    int ret;
89aef879cb5370 Daniel Scally 2021-11-23  520  
89aef879cb5370 Daniel Scally 2021-11-23  521    ret = ov5693_read_reg(ov5693, 
OV5693_EXPOSURE_CTRL_REG, &exposure);
89aef879cb5370 Daniel Scally 2021-11-23  522    if (ret)
89aef879cb5370 Daniel Scally 2021-11-23  523            return ret;
89aef879cb5370 Daniel Scally 2021-11-23  524  
89aef879cb5370 Daniel Scally 2021-11-23  525    /* The lowest 4 bits are 
unsupported fractional bits */
89aef879cb5370 Daniel Scally 2021-11-23  526    *value = exposure >> 4;
89aef879cb5370 Daniel Scally 2021-11-23  527  
89aef879cb5370 Daniel Scally 2021-11-23  528    return 0;
89aef879cb5370 Daniel Scally 2021-11-23  529  }
89aef879cb5370 Daniel Scally 2021-11-23  530  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to