[linux-next:master 4907/6030] drivers/ptp/ptp_ocp.c:830:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   7999516e20bd9bb5d1f7351cbd05ca529a3a8d60
commit: 773bda96492153e11d21eb63ac814669b51fc701 [4907/6030] ptp: ocp: Expose various resources on the timecard.
:::::: branch date: 2 days ago
:::::: commit date: 4 days ago
config: x86_64-randconfig-c001-20210807 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 41a6b50c25961addc04438b567ee1f4ef9e40f98)
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/next/linux-next.git/commit/?id=773bda96492153e11d21eb63ac814669b51fc701 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 773bda96492153e11d21eb63ac814669b51fc701
        # 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@xxxxxxxxx>


clang-analyzer warnings: (new ones prefixed by >>)
   2 warnings generated.
   Suppressed 2 warnings (2 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.
   2 warnings generated.
   Suppressed 2 warnings (2 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.
   3 warnings generated.
drivers/thermal/devfreq_cooling.c:87:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = df->dev.parent;
                          ^~~   ~~~~~~~~~~~~~~
drivers/thermal/devfreq_cooling.c:87:17: note: Value stored to 'dev' during its initialization is never read
           struct device *dev = df->dev.parent;
                          ^~~   ~~~~~~~~~~~~~~
   Suppressed 2 warnings (2 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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).
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).
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).
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).
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).
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.
drivers/media/i2c/ov5640.c:1005:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret = ov5640_mod_reg(sensor, OV5640_REG_SC_PLL_CTRL0,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov5640.c:1005:2: note: Value stored to 'ret' is never read
           ret = ov5640_mod_reg(sensor, OV5640_REG_SC_PLL_CTRL0,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   3 warnings generated.
   Suppressed 3 warnings (3 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).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   2 warnings generated.
   Suppressed 2 warnings (2 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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/ptp/ptp_ocp.c:830:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
           return err;
           ^
   drivers/ptp/ptp_ocp.c:844:7: note: 'dev' is non-null
           if (!dev) {
                ^~~
   drivers/ptp/ptp_ocp.c:844:2: note: Taking false branch
           if (!dev) {
           ^
   drivers/ptp/ptp_ocp.c:852:8: note: Calling 'ptp_ocp_devlink_flash'
           err = ptp_ocp_devlink_flash(devlink, dev, params->fw);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/ptp/ptp_ocp.c:803:2: note: 'err' declared without an initial value
           int err;
           ^~~~~~~
drivers/ptp/ptp_ocp.c:810:2: note: Loop condition is false. Execution continues on line 830
           while (resid) {
           ^
drivers/ptp/ptp_ocp.c:830:2: note: Undefined or garbage value returned to caller
           return err;
           ^      ~~~
   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.
include/linux/list.h:135:13: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
           __list_del(entry->prev, entry->next);
                      ^
drivers/media/cec/core/cec-api.c:637:29: note: Left side of '&&' is false
           struct cec_adapter *adap = to_cec_adapter(devnode);
                                      ^
drivers/media/cec/core/cec-priv.h:21:30: note: expanded from macro 'to_cec_adapter' #define to_cec_adapter(node) container_of(node, struct cec_adapter, devnode)
                                ^
   include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                                                                      ^
   drivers/media/cec/core/cec-api.c:637:29: note: Taking false branch
           struct cec_adapter *adap = to_cec_adapter(devnode);
                                      ^
drivers/media/cec/core/cec-priv.h:21:30: note: expanded from macro 'to_cec_adapter' #define to_cec_adapter(node) container_of(node, struct cec_adapter, devnode)
                                ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
           ^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert' if (!(condition)) \
                   ^
drivers/media/cec/core/cec-api.c:637:29: note: Loop condition is false. Exiting loop
           struct cec_adapter *adap = to_cec_adapter(devnode);
                                      ^
drivers/media/cec/core/cec-priv.h:21:30: note: expanded from macro 'to_cec_adapter' #define to_cec_adapter(node) container_of(node, struct cec_adapter, devnode)
                                ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
           ^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
include/linux/compiler_types.h:306:2: note: expanded from macro '__compiletime_assert' do { \
           ^
drivers/media/cec/core/cec-api.c:642:6: note: Assuming 'fh' is equal to field 'cec_initiator'
           if (adap->cec_initiator == fh)
               ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/cec/core/cec-api.c:642:2: note: Taking true branch
           if (adap->cec_initiator == fh)
           ^
drivers/media/cec/core/cec-api.c:644:6: note: Assuming 'fh' is equal to field 'cec_follower'
           if (adap->cec_follower == fh) {
               ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/cec/core/cec-api.c:644:2: note: Taking true branch
           if (adap->cec_follower == fh) {
           ^
drivers/media/cec/core/cec-api.c:648:6: note: Assuming the condition is false
           if (fh->mode_follower == CEC_MODE_FOLLOWER)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/cec/core/cec-api.c:648:2: note: Taking false branch
           if (fh->mode_follower == CEC_MODE_FOLLOWER)
           ^
drivers/media/cec/core/cec-api.c:650:6: note: Assuming the condition is true
           if (fh->mode_follower == CEC_MODE_MONITOR_PIN)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/cec/core/cec-api.c:650:2: note: Taking true branch
           if (fh->mode_follower == CEC_MODE_MONITOR_PIN)

vim +830 drivers/ptp/ptp_ocp.c

773bda96492153 Jonathan Lemon 2021-08-03 793 773bda96492153 Jonathan Lemon 2021-08-03 794 static int 773bda96492153 Jonathan Lemon 2021-08-03 795 ptp_ocp_devlink_flash(struct devlink *devlink, struct device *dev, 773bda96492153 Jonathan Lemon 2021-08-03 796 const struct firmware *fw)
773bda96492153 Jonathan Lemon 2021-08-03  797  {
773bda96492153 Jonathan Lemon 2021-08-03 798 struct mtd_info *mtd = dev_get_drvdata(dev); 773bda96492153 Jonathan Lemon 2021-08-03 799 struct ptp_ocp *bp = devlink_priv(devlink); 773bda96492153 Jonathan Lemon 2021-08-03 800 size_t off, len, resid, wrote;
773bda96492153 Jonathan Lemon 2021-08-03  801  	struct erase_info erase;
773bda96492153 Jonathan Lemon 2021-08-03  802  	size_t base, blksz;
773bda96492153 Jonathan Lemon 2021-08-03  803  	int err;
773bda96492153 Jonathan Lemon 2021-08-03 804 773bda96492153 Jonathan Lemon 2021-08-03 805 off = 0;
773bda96492153 Jonathan Lemon 2021-08-03  806  	base = bp->flash_start;
773bda96492153 Jonathan Lemon 2021-08-03  807  	blksz = 4096;
773bda96492153 Jonathan Lemon 2021-08-03  808  	resid = fw->size;
773bda96492153 Jonathan Lemon 2021-08-03 809 773bda96492153 Jonathan Lemon 2021-08-03 810 while (resid) { 773bda96492153 Jonathan Lemon 2021-08-03 811 devlink_flash_update_status_notify(devlink, "Flashing", 773bda96492153 Jonathan Lemon 2021-08-03 812 NULL, off, fw->size); 773bda96492153 Jonathan Lemon 2021-08-03 813 773bda96492153 Jonathan Lemon 2021-08-03 814 len = min_t(size_t, resid, blksz);
773bda96492153 Jonathan Lemon 2021-08-03  815  		erase.addr = base + off;
773bda96492153 Jonathan Lemon 2021-08-03  816  		erase.len = blksz;
a7e1abad13f3f0 Jonathan Lemon 2020-12-03 817 773bda96492153 Jonathan Lemon 2021-08-03 818 err = mtd_erase(mtd, &erase);
a7e1abad13f3f0 Jonathan Lemon 2020-12-03  819  		if (err)
a7e1abad13f3f0 Jonathan Lemon 2020-12-03  820  			goto out;
a7e1abad13f3f0 Jonathan Lemon 2020-12-03 821 773bda96492153 Jonathan Lemon 2021-08-03 822 err = mtd_write(mtd, base + off, len, &wrote, &fw->data[off]);
773bda96492153 Jonathan Lemon 2021-08-03  823  		if (err)
a7e1abad13f3f0 Jonathan Lemon 2020-12-03  824  			goto out;
773bda96492153 Jonathan Lemon 2021-08-03 825 773bda96492153 Jonathan Lemon 2021-08-03 826 off += blksz;
773bda96492153 Jonathan Lemon 2021-08-03  827  		resid -= len;
773bda96492153 Jonathan Lemon 2021-08-03  828  	}
773bda96492153 Jonathan Lemon 2021-08-03  829  out:
773bda96492153 Jonathan Lemon 2021-08-03 @830  	return err;
a7e1abad13f3f0 Jonathan Lemon 2020-12-03  831  }
a7e1abad13f3f0 Jonathan Lemon 2020-12-03  832
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- kbuild@xxxxxxxxxxxx
To unsubscribe send an email to kbuild-leave@xxxxxxxxxxxx


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux