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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202206200258.OlfMsjF6-lkp@intel.com>
Date:   Mon, 20 Jun 2022 02:42:33 +0800
From:   kernel test robot <lkp@...el.com>
To:     James Morse <james.morse@....com>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org
Subject: [morse:mpam/snapshot/v5.18 97/146]
 drivers/platform/mpam/mpam_devices.c:71:14: warning: variable 'cache' is
 used uninitialized whenever 'if' condition is false

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git mpam/snapshot/v5.18
head:   bac90d25cbdee0fc233b9b1c47d5b6f44101a384
commit: 49e55977a0ed88794b6abe4c959e3e28ccd54913 [97/146] arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler plate
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20220620/202206200258.OlfMsjF6-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project af6d2a0b6825e71965f3e2701a63c239fa0ad70f)
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 arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git/commit/?id=49e55977a0ed88794b6abe4c959e3e28ccd54913
        git remote add morse https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git
        git fetch --no-tags morse mpam/snapshot/v5.18
        git checkout 49e55977a0ed88794b6abe4c959e3e28ccd54913
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/perf/ drivers/platform/mpam/

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

All warnings (new ones prefixed by >>):

>> drivers/platform/mpam/mpam_devices.c:71:14: warning: variable 'cache' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                   } else if (of_device_is_compatible(np->parent, "cache")) {
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/mpam/mpam_devices.c:93:14: note: uninitialized use occurs here
           of_node_put(cache);
                       ^~~~~
   drivers/platform/mpam/mpam_devices.c:71:10: note: remove the 'if' if its condition is always true
                   } else if (of_device_is_compatible(np->parent, "cache")) {
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/mpam/mpam_devices.c:62:27: note: initialize the variable 'cache' to silence this warning
           struct device_node *cache;
                                    ^
                                     = NULL
   1 warning generated.


vim +71 drivers/platform/mpam/mpam_devices.c

    55	
    56	static int mpam_dt_parse_resource(struct mpam_msc *msc, struct device_node *np,
    57					  u32 ris_idx)
    58	{
    59		int err = 0;
    60		u32 level = 0;
    61		unsigned long cache_id;
    62		struct device_node *cache;
    63	
    64		do {
    65			if (of_device_is_compatible(np, "arm,mpam-cache")) {
    66				cache = of_parse_phandle(np, "arm,mpam-device", 0);
    67				if (!cache) {
    68					pr_err("Failed to read phandle\n");
    69					break;
    70				}
  > 71			} else if (of_device_is_compatible(np->parent, "cache")) {
    72				cache = np->parent;
    73			} else {
    74				pr_err("Not a cache\n");
    75				break;
    76			}
    77	
    78			err = of_property_read_u32(cache, "cache-level", &level);
    79			if (err) {
    80				pr_err("Failed to read cache-level\n");
    81				break;
    82			}
    83	
    84			cache_id = cache_of_get_id(cache);
    85			if (cache_id == ~0UL) {
    86				err = -ENOENT;
    87				break;
    88			}
    89	
    90			err = mpam_ris_create(msc, ris_idx, MPAM_CLASS_CACHE, level,
    91					      cache_id);
    92		} while (0);
    93		of_node_put(cache);
    94	
    95		return err;
    96	}
    97	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ