CC: [email protected]
CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Rasmus Villemoes <[email protected]>
CC: Miguel Ojeda <[email protected]>
CC: Nick Desaulniers <[email protected]>
CC: Andrew Morton <[email protected]>
CC: Linux Memory Management List <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   57ae8a492116910bad2b3497ffe555b3a4b4180f
commit: e1edc277e6f6dfb372216522dfc57f9381c39e35 linux/container_of.h: switch 
to static_assert
date:   6 months ago
:::::: branch date: 19 hours ago
:::::: commit date: 6 months ago
config: arm-randconfig-c002-20220428 
(https://download.01.org/0day-ci/archive/20220501/[email protected]/config)
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/?id=e1edc277e6f6dfb372216522dfc57f9381c39e35
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout e1edc277e6f6dfb372216522dfc57f9381c39e35
        # 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 <[email protected]>


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.
   9 warnings generated.
   drivers/rtc/rtc-rx8025.c:197:3: warning: Value stored to 'status' is never 
read [clang-analyzer-deadcode.DeadStores]
                   status &= RX8025_BIT_CTRL2_DAFG;
                   ^
   drivers/rtc/rtc-rx8025.c:197:3: note: Value stored to 'status' is never read
   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.
   9 warnings generated.
   Suppressed 9 warnings (8 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.
   9 warnings generated.
   Suppressed 9 warnings (8 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.
   11 warnings generated.
   Suppressed 11 warnings (8 in non-user code, 3 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   30 warnings generated.
   Suppressed 30 warnings (9 in non-user code, 21 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.
   22 warnings generated.
   Suppressed 22 warnings (9 in non-user code, 13 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   13 warnings generated.
   drivers/gpu/drm/amd/amdgpu/atom.c:960:2: warning: Value stored to 'dst' is 
never read [clang-analyzer-deadcode.DeadStores]
           dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/atom.c:960:2: note: Value stored to 'dst' is 
never read
           dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/atom.c:979:2: warning: Value stored to 'dst' is 
never read [clang-analyzer-deadcode.DeadStores]
           dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/atom.c:979:2: note: Value stored to 'dst' is 
never read
           dst = atom_get_dst(ctx, arg, attr, ptr, &saved, 1);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/atom.c:1386:2: warning: Value stored to 'str_off' 
is never read [clang-analyzer-deadcode.DeadStores]
           str_off = 0;
           ^         ~
   drivers/gpu/drm/amd/amdgpu/atom.c:1386:2: note: Value stored to 'str_off' is 
never read
           str_off = 0;
           ^         ~
   drivers/gpu/drm/amd/amdgpu/atom.c:1409:2: warning: Value stored to 
'off_to_vbios_str' is never read [clang-analyzer-deadcode.DeadStores]
           off_to_vbios_str = 0;
           ^                  ~
   drivers/gpu/drm/amd/amdgpu/atom.c:1409:2: note: Value stored to 
'off_to_vbios_str' is never read
           off_to_vbios_str = 0;
           ^                  ~
   Suppressed 9 warnings (9 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.
   Suppressed 9 warnings (9 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.
   Suppressed 9 warnings (9 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.
   Suppressed 9 warnings (9 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.
   Suppressed 9 warnings (9 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.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
>> drivers/misc/habanalabs/common/command_submission.c:899:2: warning: Use of 
>> memory after it is freed [clang-analyzer-unix.Malloc]
           list_for_each_entry_safe(job, tmp, &cs->job_list, cs_node)
           ^
   include/linux/list.h:717:13: note: expanded from macro 
'list_for_each_entry_safe'
           for (pos = list_first_entry(head, typeof(*pos), member),        \
                      ^
   include/linux/list.h:524:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:513:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/container_of.h:18:25: note: expanded from macro 'container_of'
           void *__mptr = (void *)(ptr);                                   \
                                  ^
   drivers/misc/habanalabs/common/command_submission.c:1965:6: note: 'rc' is 0
           if (rc)
               ^~
   drivers/misc/habanalabs/common/command_submission.c:1965:2: note: Taking 
false branch
           if (rc)
           ^
   drivers/misc/habanalabs/common/command_submission.c:1971:6: note: Assuming 
field 'queue_index' is < field 'max_queues'
           if (chunk->queue_index >= hdev->asic_prop.max_queues) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:1971:2: note: Taking 
false branch
           if (chunk->queue_index >= hdev->asic_prop.max_queues) {
           ^
   drivers/misc/habanalabs/common/command_submission.c:1984:6: note: Assuming 
field 'supports_sync_stream' is not equal to 0
           if (!hw_queue_prop->supports_sync_stream) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:1984:2: note: Taking 
false branch
           if (!hw_queue_prop->supports_sync_stream) {
           ^
   drivers/misc/habanalabs/common/command_submission.c:1994:6: note: Assuming 
'cs_type' is not equal to CS_TYPE_COLLECTIVE_WAIT
           if (cs_type == CS_TYPE_COLLECTIVE_WAIT) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:1994:2: note: Taking 
false branch
           if (cs_type == CS_TYPE_COLLECTIVE_WAIT) {
           ^
   drivers/misc/habanalabs/common/command_submission.c:2016:18: note: Assuming 
'cs_type' is not equal to CS_TYPE_WAIT
           is_wait_cs = !!(cs_type == CS_TYPE_WAIT ||
                           ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2016:18: note: Left side 
of '||' is false
   drivers/misc/habanalabs/common/command_submission.c:2017:4: note: 'cs_type' 
is not equal to CS_TYPE_COLLECTIVE_WAIT
                           cs_type == CS_TYPE_COLLECTIVE_WAIT);
                           ^~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2019:23: note: Assuming 
the condition is false
           cs_encaps_signals = !!(flags & HL_CS_FLAGS_ENCAP_SIGNALS);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2021:6: note: 
'is_wait_cs' is false
           if (is_wait_cs) {
               ^~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:2021:2: note: Taking 
false branch
           if (is_wait_cs) {
           ^
   drivers/misc/habanalabs/common/command_submission.c:2113:7: note: Calling 
'allocate_cs'
           rc = allocate_cs(hdev, ctx, cs_type, ULLONG_MAX, &cs, flags, 
timeout);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:778:6: note: Assuming 
'cs' is non-null
           if (!cs)
               ^~~
   drivers/misc/habanalabs/common/command_submission.c:778:2: note: Taking 
false branch
           if (!cs)
           ^
   drivers/misc/habanalabs/common/command_submission.c:781:7: note: 'cs' is 
non-null
           if (!cs) {
                ^~
   drivers/misc/habanalabs/common/command_submission.c:781:2: note: Taking 
false branch
           if (!cs) {
           ^
   drivers/misc/habanalabs/common/command_submission.c:794:19: note: Assuming 
the condition is false
           cs->timestamp = !!(flags & HL_CS_FLAGS_TIMESTAMP);
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:798:3: note: Assuming 
field 'skip_reset_on_timeout' is 0
                   hdev->skip_reset_on_timeout ||
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:798:3: note: Left side 
of '||' is false
   drivers/misc/habanalabs/common/command_submission.c:799:4: note: Assuming 
the condition is false
                   !!(flags & HL_CS_FLAGS_SKIP_RESET_ON_TIMEOUT);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/habanalabs/common/command_submission.c:802:2: note: Loop 
condition is false.  Exiting loop
           INIT_DELAYED_WORK(&cs->work_tdr, cs_timedout);
           ^
   include/linux/workqueue.h:267:2: note: expanded from macro 
'INIT_DELAYED_WORK'
           __INIT_DELAYED_WORK(_work, _func, 0)
           ^
   include/linux/workqueue.h:252:3: note: expanded from macro 
'__INIT_DELAYED_WORK'
                   INIT_WORK(&(_work)->work, (_func));                     \
                   ^
   include/linux/workqueue.h:245:2: note: expanded from macro 'INIT_WORK'
           __INIT_WORK((_work), (_func), 0)
           ^
   include/linux/workqueue.h:225:2: note: expanded from macro '__INIT_WORK'
           do {                                                            \
           ^
   drivers/misc/habanalabs/common/command_submission.c:802:2: note: Loop 
condition is false.  Exiting loop
           INIT_DELAYED_WORK(&cs->work_tdr, cs_timedout);
           ^
   include/linux/workqueue.h:267:2: note: expanded from macro 
'INIT_DELAYED_WORK'
           __INIT_DELAYED_WORK(_work, _func, 0)
           ^

vim +899 drivers/misc/habanalabs/common/command_submission.c

eff6f4a0e70b7b drivers/misc/habanalabs/command_submission.c        Oded Gabbay 
2019-02-16  892  
eff6f4a0e70b7b drivers/misc/habanalabs/command_submission.c        Oded Gabbay 
2019-02-16  893  static void cs_rollback(struct hl_device *hdev, struct hl_cs 
*cs)
eff6f4a0e70b7b drivers/misc/habanalabs/command_submission.c        Oded Gabbay 
2019-02-16  894  {
eff6f4a0e70b7b drivers/misc/habanalabs/command_submission.c        Oded Gabbay 
2019-02-16  895          struct hl_cs_job *job, *tmp;
eff6f4a0e70b7b drivers/misc/habanalabs/command_submission.c        Oded Gabbay 
2019-02-16  896  
2795c8891577c4 drivers/misc/habanalabs/common/command_submission.c Ofir Bitton 
2020-12-08  897          staged_cs_put(hdev, cs);
2795c8891577c4 drivers/misc/habanalabs/common/command_submission.c Ofir Bitton 
2020-12-08  898  
eff6f4a0e70b7b drivers/misc/habanalabs/command_submission.c        Oded Gabbay 
2019-02-16 @899          list_for_each_entry_safe(job, tmp, &cs->job_list, 
cs_node)
649c4592124b0c drivers/misc/habanalabs/common/command_submission.c Tomer Tayar 
2020-08-10  900                  complete_job(hdev, job);
eff6f4a0e70b7b drivers/misc/habanalabs/command_submission.c        Oded Gabbay 
2019-02-16  901  }
eff6f4a0e70b7b drivers/misc/habanalabs/command_submission.c        Oded Gabbay 
2019-02-16  902  

:::::: The code at line 899 was first introduced by commit
:::::: eff6f4a0e70b7bcf4674f471a768860a74e638a6 habanalabs: add command 
submission module

:::::: TO: Oded Gabbay <[email protected]>
:::::: CC: Greg Kroah-Hartman <[email protected]>

-- 
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