lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202108152213.za9e7Rao-lkp@intel.com>
Date:   Sun, 15 Aug 2021 22:29:24 +0800
From:   kernel test robot <lkp@...el.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     clang-built-linux@...glegroups.com, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org, Maxime Ripard <maxime@...no.tech>
Subject: drivers/gpu/drm/bridge/analogix/anx7625.c:754:4: warning: Value
 stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0aa78d17099b04fd9d36fe338af48ad6fe2d7fca
commit: c489573b5b6ce6442ad4658d9d5ec77839b91622 Merge drm/drm-next into drm-misc-next
date:   10 months ago
config: x86_64-randconfig-c001-20210813 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 767496d19cb9a1fbba57ff08095faa161998ee36)
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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c489573b5b6ce6442ad4658d9d5ec77839b91622
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout c489573b5b6ce6442ad4658d9d5ec77839b91622
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>


clang-analyzer warnings: (new ones prefixed by >>)
   7 warnings generated.
   Suppressed 7 warnings (7 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.
   7 warnings generated.
   Suppressed 7 warnings (7 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   15 warnings generated.
   net/core/filter.c:1736:2: warning: Null pointer passed as 1st argument to memory set function [clang-analyzer-unix.cstring.NullArg]
           memset(to, 0, len);
           ^
   net/core/filter.c:9941:57: note: Passing value via 3rd parameter 'to'
           return ____bpf_skb_load_bytes(reuse_kern->skb, offset, to, len);
                                                                  ^~
   net/core/filter.c:9941:9: note: Calling '____bpf_skb_load_bytes'
           return ____bpf_skb_load_bytes(reuse_kern->skb, offset, to, len);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/core/filter.c:1725:15: note: Assuming 'offset' is <= 65535
           if (unlikely(offset > 0xffff))
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/core/filter.c:1725:2: note: Taking false branch
           if (unlikely(offset > 0xffff))
           ^
   net/core/filter.c:1729:15: note: Assuming 'ptr' is null
           if (unlikely(!ptr))
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/core/filter.c:1729:2: note: Taking true branch
           if (unlikely(!ptr))
           ^
   net/core/filter.c:1730:3: note: Control jumps to line 1736
                   goto err_clear;
                   ^
   net/core/filter.c:1736:2: note: Null pointer passed as 1st argument to memory set function
           memset(to, 0, len);
           ^      ~~
   net/core/filter.c:1770:2: warning: Null pointer passed as 1st argument to memory set function [clang-analyzer-unix.cstring.NullArg]
           memset(to, 0, len);
           ^      ~~
   net/core/filter.c:1756:15: note: Assuming 'offset' is <= 65535
           if (unlikely(offset > 0xffff))
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/core/filter.c:1756:2: note: Taking false branch
           if (unlikely(offset > 0xffff))
           ^
   net/core/filter.c:1759:15: note: Assuming field 'skb' is non-null
           if (unlikely(!ctx->skb))
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/core/filter.c:1759:2: note: Taking false branch
           if (unlikely(!ctx->skb))
           ^
   net/core/filter.c:1763:15: note: Assuming 'ptr' is null
           if (unlikely(!ptr))
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/core/filter.c:1763:2: note: Taking true branch
           if (unlikely(!ptr))
           ^
   net/core/filter.c:1764:3: note: Control jumps to line 1770
                   goto err_clear;
                   ^
   net/core/filter.c:1770:2: note: Null pointer passed as 1st argument to memory set function
           memset(to, 0, len);
           ^      ~~
   Suppressed 13 warnings (13 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.
   Suppressed 12 warnings (12 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.
   7 warnings generated.
>> drivers/gpu/drm/bridge/analogix/anx7625.c:754:4: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
                           ret = sp_tx_rst_aux(ctx);
                           ^     ~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/bridge/analogix/anx7625.c:754:4: note: Value stored to 'ret' is never read
                           ret = sp_tx_rst_aux(ctx);
                           ^     ~~~~~~~~~~~~~~~~~~
   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.
   8 warnings generated.
   drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c:536:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = anx78xx_clear_bits(anx78xx->map[I2C_IDX_TX_P2],
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c:536:2: note: Value stored to 'err' is never read
           err = anx78xx_clear_bits(anx78xx->map[I2C_IDX_TX_P2],
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 7 warnings (7 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.
   7 warnings generated.
   Suppressed 7 warnings (7 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.
   drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c:424:2: warning: Value stored to 'reg' is never read [clang-analyzer-deadcode.DeadStores]
           reg = readl(dp->reg_base + ANALOGIX_DP_SYS_CTL_3);
           ^
   drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c:424:2: note: Value stored to 'reg' is never read
   Suppressed 7 warnings (6 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   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.
   7 warnings generated.
   Suppressed 7 warnings (7 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.
   7 warnings generated.
   Suppressed 7 warnings (7 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.
   7 warnings generated.
   Suppressed 7 warnings (7 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.
   7 warnings generated.
   Suppressed 7 warnings (7 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.
   7 warnings generated.
   Suppressed 7 warnings (7 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.
   4 warnings generated.
   Suppressed 4 warnings (4 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.
   5 warnings generated.
   drivers/media/dvb-frontends/tda1004x.c:547:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret = tda1004x_do_upload(state, fw->data, fw->size, TDA10046H_CODE_CPT, TDA10046H_CODE_IN);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/dvb-frontends/tda1004x.c:547:2: note: Value stored to 'ret' is never read
           ret = tda1004x_do_upload(state, fw->data, fw->size, TDA10046H_CODE_CPT, TDA10046H_CODE_IN);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 4 warnings (4 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.
   drivers/media/dvb-frontends/sp887x.c:143:23: warning: Value stored to 'mem' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           const unsigned char *mem = fw->data;
                                ^~~   ~~~~~~~~
   drivers/media/dvb-frontends/sp887x.c:143:23: note: Value stored to 'mem' during its initialization is never read
           const unsigned char *mem = fw->data;
                                ^~~   ~~~~~~~~
   drivers/media/dvb-frontends/sp887x.c:458:39: warning: The result of the left shift is undefined because the left operand is negative [clang-analyzer-core.UndefinedBinaryOperatorResult]
                  (sp887x_readreg(state, 0xc07) << 6);
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
   drivers/media/dvb-frontends/sp887x.c:458:10: note: Calling 'sp887x_readreg'
                  (sp887x_readreg(state, 0xc07) << 6);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/dvb-frontends/sp887x.c:84:6: note: Assuming the condition is true
           if ((ret = i2c_transfer(state->i2c, msg, 2)) != 2) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/dvb-frontends/sp887x.c:84:2: note: Taking true branch
           if ((ret = i2c_transfer(state->i2c, msg, 2)) != 2) {
           ^
   drivers/media/dvb-frontends/sp887x.c:86:3: note: Returning the value -1
                   return -1;
                   ^~~~~~~~~
   drivers/media/dvb-frontends/sp887x.c:458:10: note: Returning from 'sp887x_readreg'
                  (sp887x_readreg(state, 0xc07) << 6);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/dvb-frontends/sp887x.c:458:39: note: The result of the left shift is undefined because the left operand is negative
                  (sp887x_readreg(state, 0xc07) << 6);
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
   Suppressed 4 warnings (4 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.
   4 warnings generated.
   Suppressed 4 warnings (4 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.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).

vim +/ret +754 drivers/gpu/drm/bridge/analogix/anx7625.c

8bdfc5dae4e3ba Xin Ji 2020-09-18  720  
8bdfc5dae4e3ba Xin Ji 2020-09-18  721  static int segments_edid_read(struct anx7625_data *ctx,
8bdfc5dae4e3ba Xin Ji 2020-09-18  722  			      u8 segment, u8 *buf, u8 offset)
8bdfc5dae4e3ba Xin Ji 2020-09-18  723  {
8bdfc5dae4e3ba Xin Ji 2020-09-18  724  	u8 cnt;
8bdfc5dae4e3ba Xin Ji 2020-09-18  725  	int ret;
8bdfc5dae4e3ba Xin Ji 2020-09-18  726  	struct device *dev = &ctx->client->dev;
8bdfc5dae4e3ba Xin Ji 2020-09-18  727  
8bdfc5dae4e3ba Xin Ji 2020-09-18  728  	/* Write address only */
8bdfc5dae4e3ba Xin Ji 2020-09-18  729  	ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client,
8bdfc5dae4e3ba Xin Ji 2020-09-18  730  				AP_AUX_ADDR_7_0, 0x30);
8bdfc5dae4e3ba Xin Ji 2020-09-18  731  	ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client,
8bdfc5dae4e3ba Xin Ji 2020-09-18  732  				 AP_AUX_COMMAND, 0x04);
8bdfc5dae4e3ba Xin Ji 2020-09-18  733  	ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client,
8bdfc5dae4e3ba Xin Ji 2020-09-18  734  				 AP_AUX_CTRL_STATUS,
8bdfc5dae4e3ba Xin Ji 2020-09-18  735  				 AP_AUX_CTRL_ADDRONLY | AP_AUX_CTRL_OP_EN);
8bdfc5dae4e3ba Xin Ji 2020-09-18  736  
8bdfc5dae4e3ba Xin Ji 2020-09-18  737  	ret |= wait_aux_op_finish(ctx);
8bdfc5dae4e3ba Xin Ji 2020-09-18  738  	/* Write segment address */
8bdfc5dae4e3ba Xin Ji 2020-09-18  739  	ret |= sp_tx_aux_wr(ctx, segment);
8bdfc5dae4e3ba Xin Ji 2020-09-18  740  	/* Data read */
8bdfc5dae4e3ba Xin Ji 2020-09-18  741  	ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client,
8bdfc5dae4e3ba Xin Ji 2020-09-18  742  				 AP_AUX_ADDR_7_0, 0x50);
8bdfc5dae4e3ba Xin Ji 2020-09-18  743  	if (ret) {
8bdfc5dae4e3ba Xin Ji 2020-09-18  744  		DRM_DEV_ERROR(dev, "IO error : aux initial fail.\n");
8bdfc5dae4e3ba Xin Ji 2020-09-18  745  		return ret;
8bdfc5dae4e3ba Xin Ji 2020-09-18  746  	}
8bdfc5dae4e3ba Xin Ji 2020-09-18  747  
8bdfc5dae4e3ba Xin Ji 2020-09-18  748  	for (cnt = 0; cnt <= EDID_TRY_CNT; cnt++) {
8bdfc5dae4e3ba Xin Ji 2020-09-18  749  		sp_tx_aux_wr(ctx, offset);
8bdfc5dae4e3ba Xin Ji 2020-09-18  750  		/* Set I2C read com 0x01 mot = 0 and read 16 bytes */
8bdfc5dae4e3ba Xin Ji 2020-09-18  751  		ret = sp_tx_aux_rd(ctx, 0xf1);
8bdfc5dae4e3ba Xin Ji 2020-09-18  752  
8bdfc5dae4e3ba Xin Ji 2020-09-18  753  		if (ret) {
8bdfc5dae4e3ba Xin Ji 2020-09-18 @754  			ret = sp_tx_rst_aux(ctx);
8bdfc5dae4e3ba Xin Ji 2020-09-18  755  			DRM_DEV_ERROR(dev, "segment read fail, reset!\n");
8bdfc5dae4e3ba Xin Ji 2020-09-18  756  		} else {
8bdfc5dae4e3ba Xin Ji 2020-09-18  757  			ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client,
8bdfc5dae4e3ba Xin Ji 2020-09-18  758  						     AP_AUX_BUFF_START,
8bdfc5dae4e3ba Xin Ji 2020-09-18  759  						     MAX_DPCD_BUFFER_SIZE, buf);
8bdfc5dae4e3ba Xin Ji 2020-09-18  760  			if (ret > 0)
8bdfc5dae4e3ba Xin Ji 2020-09-18  761  				break;
8bdfc5dae4e3ba Xin Ji 2020-09-18  762  		}
8bdfc5dae4e3ba Xin Ji 2020-09-18  763  	}
8bdfc5dae4e3ba Xin Ji 2020-09-18  764  
8bdfc5dae4e3ba Xin Ji 2020-09-18  765  	if (cnt > EDID_TRY_CNT)
8bdfc5dae4e3ba Xin Ji 2020-09-18  766  		return -EIO;
8bdfc5dae4e3ba Xin Ji 2020-09-18  767  
8bdfc5dae4e3ba Xin Ji 2020-09-18  768  	return 0;
8bdfc5dae4e3ba Xin Ji 2020-09-18  769  }
8bdfc5dae4e3ba Xin Ji 2020-09-18  770  

:::::: The code at line 754 was first introduced by commit
:::::: 8bdfc5dae4e3ba4d99dfb430ef43249e5f1b7730 drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP

:::::: TO: Xin Ji <xji@...logixsemi.com>
:::::: CC: Sam Ravnborg <sam@...nborg.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (36569 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ