CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Murali Karicheri <[email protected]>
CC: Vignesh Raghavendra <[email protected]>
CC: Kishon Vijay Abraham I <[email protected]>

tree:   git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-rt-linux-5.10.y
head:   541ec9a6995c3dd881d6f0b63cc714a08ded457d
commit: 46bd10a0a3c2a29437907681cafda860a72e86cf [7485/10213] net: hsr: Support 
VLAN tagged supervision frames
:::::: branch date: 7 days ago
:::::: commit date: 5 months ago
config: i386-randconfig-c001-20211209 
(https://download.01.org/0day-ci/archive/20211210/[email protected]/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
097a1cb1d5ebb3a0ec4bcaed8ba3ff6a8e33c00a)
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
        git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
        git fetch --no-tags ti ti-rt-linux-5.10.y
        git checkout 46bd10a0a3c2a29437907681cafda860a72e86cf
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 
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 >>)
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/drm_dp_mst_topology.c:297:6: note: Assuming the condition is 
false
           if (buf[0] == 0)
               ^~~~~~~~~~~
   drivers/gpu/drm/drm_dp_mst_topology.c:297:2: note: Taking false branch
           if (buf[0] == 0)
           ^
   drivers/gpu/drm/drm_dp_mst_topology.c:301:6: note: Assuming 'len' is <= 
'buflen'
           if (len > buflen)
               ^~~~~~~~~~~~
   drivers/gpu/drm/drm_dp_mst_topology.c:301:2: note: Taking false branch
           if (len > buflen)
           ^
   drivers/gpu/drm/drm_dp_mst_topology.c:305:6: note: Assuming the condition is 
false
           if ((crc4 & 0xf) != (buf[len - 1] & 0xf)) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/drm_dp_mst_topology.c:305:2: note: Taking false branch
           if ((crc4 & 0xf) != (buf[len - 1] & 0xf)) {
           ^
   drivers/gpu/drm/drm_dp_mst_topology.c:313:14: note: Assuming the condition 
is false
           for (i = 0; i < (hdr->lct / 2); i++)
                       ^~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/drm_dp_mst_topology.c:313:2: note: Loop condition is false. 
Execution continues on line 315
           for (i = 0; i < (hdr->lct / 2); i++)
           ^
   drivers/gpu/drm/drm_dp_mst_topology.c:3917:8: note: Returning from 
'drm_dp_decode_sideband_msg_hdr'
           ret = drm_dp_decode_sideband_msg_hdr(&hdr, replyblock, len, &hdrlen);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/drm_dp_mst_topology.c:3918:6: note: 'ret' is not equal to 
false
           if (ret == false) {
               ^~~
   drivers/gpu/drm/drm_dp_mst_topology.c:3918:2: note: Taking false branch
           if (ret == false) {
           ^
   drivers/gpu/drm/drm_dp_mst_topology.c:3925:7: note: 'up' is false
           if (!up) {
                ^~
   drivers/gpu/drm/drm_dp_mst_topology.c:3925:2: note: Taking true branch
           if (!up) {
           ^
   drivers/gpu/drm/drm_dp_mst_topology.c:3927:11: note: Calling 
'drm_dp_get_mst_branch_device'
                   *mstb = drm_dp_get_mst_branch_device(mgr, hdr.lct, hdr.rad);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/drm_dp_mst_topology.c:2601:6: note: Assuming 'mstb' is 
non-null
           if (!mstb)
               ^~~~~
   drivers/gpu/drm/drm_dp_mst_topology.c:2601:2: note: Taking false branch
           if (!mstb)
           ^
   drivers/gpu/drm/drm_dp_mst_topology.c:2604:7: note: The value 0 is assigned 
to 'i'
           for (i = 0; i < lct - 1; i++) {
                ^~~~~
   drivers/gpu/drm/drm_dp_mst_topology.c:2604:14: note: Assuming the condition 
is true
           for (i = 0; i < lct - 1; i++) {
                       ^~~~~~~~~~~
   drivers/gpu/drm/drm_dp_mst_topology.c:2604:2: note: Loop condition is true.  
Entering loop body
           for (i = 0; i < lct - 1; i++) {
           ^
   drivers/gpu/drm/drm_dp_mst_topology.c:2605:15: note: '?' condition is false
                   int shift = (i % 2) ? 0 : 4;
                               ^
   drivers/gpu/drm/drm_dp_mst_topology.c:2606:30: note: The left operand of 
'>>' is a garbage value
                   int port_num = (rad[i / 2] >> shift) & 0xf;
                                   ~~~~~~~~~~ ^
   drivers/gpu/drm/drm_dp_mst_topology.c:3292:2: warning: Value stored to 'len' 
is never read [clang-analyzer-deadcode.DeadStores]
           len = build_query_stream_enc_status(txmsg, port->vcpi.vcpi, nonce);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/drm_dp_mst_topology.c:3292:2: note: Value stored to 'len' is 
never read
           len = build_query_stream_enc_status(txmsg, port->vcpi.vcpi, nonce);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 5 warnings (4 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.
   6 warnings generated.
   Suppressed 6 warnings (6 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.
   6 warnings generated.
   Suppressed 6 warnings (6 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.
   6 warnings generated.
   Suppressed 6 warnings (6 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.
   6 warnings generated.
   Suppressed 6 warnings (6 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.
   6 warnings generated.
   Suppressed 6 warnings (6 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.
   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.
   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.
   12 warnings generated.
>> net/hsr/hsr_device.c:387:19: warning: Value stored to 'hsr' during its 
>> initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct hsr_priv *hsr = master->hsr;
                            ^~~   ~~~~~~~~~~~
   net/hsr/hsr_device.c:387:19: note: Value stored to 'hsr' during its 
initialization is never read
           struct hsr_priv *hsr = master->hsr;
                            ^~~   ~~~~~~~~~~~
   net/hsr/hsr_device.c:497:24: warning: Access to field 'sequence_nr' results 
in a dereference of a null pointer (loaded from variable 'hsr_tag') 
[clang-analyzer-core.NullDereference]
                   hsr_tag->sequence_nr = htons(hsr->sequence_nr);
                   ~~~~~~~              ^
   net/hsr/hsr_device.c:445:2: note: 'hsr_tag' initialized to a null pointer 
value
           struct hsr_tag *hsr_tag = NULL;
           ^~~~~~~~~~~~~~~~~~~~~~~
   net/hsr/hsr_device.c:455:6: note: Assuming field 'announce_count' is >= 3
           if (hsr->announce_count < 3 && hsr->prot_version == 0) {
               ^~~~~~~~~~~~~~~~~~~~~~~
   net/hsr/hsr_device.c:455:30: note: Left side of '&&' is false
           if (hsr->announce_count < 3 && hsr->prot_version == 0) {
                                       ^
   net/hsr/hsr_device.c:461:6: note: Assuming field 'prot_version' is not equal 
to 0
           if (!hsr->prot_version)
               ^~~~~~~~~~~~~~~~~~
   net/hsr/hsr_device.c:461:2: note: Taking false branch
           if (!hsr->prot_version)
           ^
   net/hsr/hsr_device.c:466:8: note: Calling 'hsr_init_skb'
           skb = hsr_init_skb(master, proto);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/hsr/hsr_device.c:394:6: note: Assuming field 'disable_sv_frame' is 0
           if (hsr->disable_sv_frame)
               ^~~~~~~~~~~~~~~~~~~~~
   net/hsr/hsr_device.c:394:2: note: Taking false branch
           if (hsr->disable_sv_frame)
           ^
   net/hsr/hsr_device.c:403:6: note: Assuming field 'use_vlan_for_sv' is 0
           if (hsr->use_vlan_for_sv)
               ^~~~~~~~~~~~~~~~~~~~
   net/hsr/hsr_device.c:403:2: note: Taking false branch
           if (hsr->use_vlan_for_sv)
           ^
   net/hsr/hsr_device.c:411:6: note: Assuming 'skb' is non-null, which 
participates in a condition later
           if (!skb)
               ^~~~
   net/hsr/hsr_device.c:411:2: note: Taking false branch
           if (!skb)
           ^
   net/hsr/hsr_device.c:416:11: note: Field 'use_vlan_for_sv' is 0
           if (hsr->use_vlan_for_sv) {
                    ^
   net/hsr/hsr_device.c:416:2: note: Taking false branch
           if (hsr->use_vlan_for_sv) {
           ^
   net/hsr/hsr_device.c:424:6: note: Assuming the condition is false
           if (dev_hard_header(skb, skb->dev, proto,
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/hsr/hsr_device.c:424:2: note: Taking false branch
           if (dev_hard_header(skb, skb->dev, proto,
           ^
   net/hsr/hsr_device.c:433:2: note: Returning pointer (loaded from 'skb'), 
which participates in a condition later
           return skb;
           ^~~~~~~~~~
   net/hsr/hsr_device.c:466:8: note: Returning from 'hsr_init_skb'
           skb = hsr_init_skb(master, proto);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/hsr/hsr_device.c:467:7: note: 'skb' is non-null
           if (!skb) {
                ^~~
   net/hsr/hsr_device.c:467:2: note: Taking false branch
           if (!skb) {
           ^
   net/hsr/hsr_device.c:472:6: note: Assuming field 'use_vlan_for_sv' is 0
           if (hsr->use_vlan_for_sv) {
               ^~~~~~~~~~~~~~~~~~~~
   net/hsr/hsr_device.c:472:2: note: Taking false branch
           if (hsr->use_vlan_for_sv) {
           ^
   net/hsr/hsr_device.c:482:6: note: Assuming field 'prot_version' is <= 0
           if (hsr->prot_version > 0) {
               ^~~~~~~~~~~~~~~~~~~~~
   net/hsr/hsr_device.c:482:2: note: Taking false branch
           if (hsr->prot_version > 0) {
           ^
   net/hsr/hsr_device.c:489:36: note: Field 'prot_version' is 0
           set_hsr_stag_path(hsr_stag, (hsr->prot_version ? 0x0 : 0xf));
                                             ^
   net/hsr/hsr_device.c:489:31: note: '?' condition is false
           set_hsr_stag_path(hsr_stag, (hsr->prot_version ? 0x0 : 0xf));
                                        ^
   net/hsr/hsr_device.c:493:2: note: Loop condition is false.  Exiting loop
           spin_lock_irqsave(&master->hsr->seqnr_lock, irqflags);
           ^
   include/linux/spinlock.h:384:2: note: expanded from macro 'spin_lock_irqsave'
           raw_spin_lock_irqsave(spinlock_check(lock), flags);     \
           ^
   include/linux/spinlock.h:250:2: note: expanded from macro 
'raw_spin_lock_irqsave'
           do {                                            \
           ^
   net/hsr/hsr_device.c:493:2: note: Loop condition is false.  Exiting loop
           spin_lock_irqsave(&master->hsr->seqnr_lock, irqflags);
           ^
   include/linux/spinlock.h:382:43: note: expanded from macro 
'spin_lock_irqsave'
   #define spin_lock_irqsave(lock, flags)                          \

vim +/hsr +387 net/hsr/hsr_device.c

f421436a591d34 Arvid Brodin     2013-10-30  384  
28e458e097f32a Murali Karicheri 2020-07-22  385  static struct sk_buff 
*hsr_init_skb(struct hsr_port *master, u16 proto)
f421436a591d34 Arvid Brodin     2013-10-30  386  {
121c33b07b3127 Murali Karicheri 2020-07-22 @387         struct hsr_priv *hsr = 
master->hsr;
f421436a591d34 Arvid Brodin     2013-10-30  388         struct sk_buff *skb;
f421436a591d34 Arvid Brodin     2013-10-30  389         int hlen, tlen;
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  390         int len;
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  391  
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  392         hsr = master->hsr;
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  393  
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  394         if 
(hsr->disable_sv_frame)
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  395                 return NULL;
f421436a591d34 Arvid Brodin     2013-10-30  396  
c5a75911721002 Arvid Brodin     2014-07-04  397         hlen = 
LL_RESERVED_SPACE(master->dev);
c5a75911721002 Arvid Brodin     2014-07-04  398         tlen = 
master->dev->needed_tailroom;
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  399         len = sizeof(struct 
hsr_tag) +
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  400               sizeof(struct 
hsr_sup_tag) +
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  401               sizeof(struct 
hsr_sup_payload) + hlen + tlen;
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  402  
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  403         if 
(hsr->use_vlan_for_sv)
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  404                 len += 
VLAN_HLEN;
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  405  
c643ff0383c858 Murali Karicheri 2020-07-22  406         /* skb size is same for 
PRP/HSR frames, only difference
c643ff0383c858 Murali Karicheri 2020-07-22  407          * being, for PRP it is 
a trailer and for HSR it is a
c643ff0383c858 Murali Karicheri 2020-07-22  408          * header
c643ff0383c858 Murali Karicheri 2020-07-22  409          */
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  410         skb = 
dev_alloc_skb(len);
05ca6e644dc9b7 Murali Karicheri 2019-04-05  411         if (!skb)
121c33b07b3127 Murali Karicheri 2020-07-22  412                 return skb;
f421436a591d34 Arvid Brodin     2013-10-30  413  
f421436a591d34 Arvid Brodin     2013-10-30  414         skb_reserve(skb, hlen);
c5a75911721002 Arvid Brodin     2014-07-04  415         skb->dev = master->dev;
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  416         if 
(hsr->use_vlan_for_sv) {
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  417                 proto = 
ETH_P_8021Q;
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  418                 skb->priority = 
hsr->sv_frame_pcp;
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  419         } else {
f421436a591d34 Arvid Brodin     2013-10-30  420                 skb->priority = 
TC_PRIO_CONTROL;
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  421         }
46bd10a0a3c2a2 Murali Karicheri 2021-07-08  422         skb->protocol = 
htons(proto);
f421436a591d34 Arvid Brodin     2013-10-30  423  
28e458e097f32a Murali Karicheri 2020-07-22  424         if 
(dev_hard_header(skb, skb->dev, proto,
121c33b07b3127 Murali Karicheri 2020-07-22  425                             
hsr->sup_multicast_addr,
f266a683a4804d Arvid Brodin     2014-07-04  426                             
skb->dev->dev_addr, skb->len) <= 0)
f421436a591d34 Arvid Brodin     2013-10-30  427                 goto out;
121c33b07b3127 Murali Karicheri 2020-07-22  428  
f266a683a4804d Arvid Brodin     2014-07-04  429         
skb_reset_mac_header(skb);
3ed0a1d563903b Taehee Yoo       2019-12-22  430         
skb_reset_network_header(skb);
3ed0a1d563903b Taehee Yoo       2019-12-22  431         
skb_reset_transport_header(skb);
f421436a591d34 Arvid Brodin     2013-10-30  432  
121c33b07b3127 Murali Karicheri 2020-07-22  433         return skb;
121c33b07b3127 Murali Karicheri 2020-07-22  434  out:
121c33b07b3127 Murali Karicheri 2020-07-22  435         kfree_skb(skb);
121c33b07b3127 Murali Karicheri 2020-07-22  436  
121c33b07b3127 Murali Karicheri 2020-07-22  437         return NULL;
121c33b07b3127 Murali Karicheri 2020-07-22  438  }
121c33b07b3127 Murali Karicheri 2020-07-22  439  

:::::: The code at line 387 was first introduced by commit
:::::: 121c33b07b3127f501b366bc23d2a590e2f2b8ef net: hsr: introduce common code 
for skb initialization

:::::: TO: Murali Karicheri <[email protected]>
:::::: CC: David S. Miller <[email protected]>

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

Reply via email to