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: <202206121940.30TYe8Nk-lkp@intel.com>
Date:   Mon, 13 Jun 2022 17:33:35 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     kbuild@...ts.01.org, Haren Myneni <haren@...ux.ibm.com>
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org, Michael Ellerman <mpe@...erman.id.au>
Subject: drivers/crypto/nx/nx-common-pseries.c:1146 nxcop_get_capabilities()
 error: uninitialized symbol 'hv_nxc'.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0678afa6055d14799c1dc1eee47c8025eba56cab
commit: b4ba22114c78de48fda3818f569f75e97d58c719 crypto/nx: Get NX capabilities for GZIP coprocessor type
config: powerpc64-randconfig-m031-20220611 (https://download.01.org/0day-ci/archive/20220612/202206121940.30TYe8Nk-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 11.3.0

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

smatch warnings:
drivers/crypto/nx/nx-common-pseries.c:1146 nxcop_get_capabilities() error: uninitialized symbol 'hv_nxc'.

vim +/hv_nxc +1146 drivers/crypto/nx/nx-common-pseries.c

b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1098  static void __init nxcop_get_capabilities(void)
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1099  {
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1100  	struct hv_vas_all_caps *hv_caps;
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1101  	struct hv_nx_cop_caps *hv_nxc;
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1102  	int rc;
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1103  
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1104  	hv_caps = kmalloc(sizeof(*hv_caps), GFP_KERNEL);
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1105  	if (!hv_caps)
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1106  		return;
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1107  	/*
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1108  	 * Get NX overall capabilities with feature type=0
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1109  	 */
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1110  	rc = h_query_vas_capabilities(H_QUERY_NX_CAPABILITIES, 0,
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1111  					  (u64)virt_to_phys(hv_caps));
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1112  	if (rc)
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1113  		goto out;
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1114  
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1115  	caps_feat = be64_to_cpu(hv_caps->feat_type);
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1116  	/*
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1117  	 * NX-GZIP feature available
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1118  	 */
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1119  	if (caps_feat & VAS_NX_GZIP_FEAT_BIT) {
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1120  		hv_nxc = kmalloc(sizeof(*hv_nxc), GFP_KERNEL);
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1121  		if (!hv_nxc)
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1122  			goto out;
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1123  		/*
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1124  		 * Get capabilities for NX-GZIP feature
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1125  		 */
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1126  		rc = h_query_vas_capabilities(H_QUERY_NX_CAPABILITIES,
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1127  						  VAS_NX_GZIP_FEAT,
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1128  						  (u64)virt_to_phys(hv_nxc));
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1129  	} else {
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1130  		pr_err("NX-GZIP feature is not available\n");
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1131  		rc = -EINVAL;

hv_nxc is not initialized on this path.

b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1132  	}
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1133  
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1134  	if (!rc) {
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1135  		nx_cop_caps.descriptor = be64_to_cpu(hv_nxc->descriptor);
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1136  		nx_cop_caps.req_max_processed_len =
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1137  				be64_to_cpu(hv_nxc->req_max_processed_len);
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1138  		nx_cop_caps.min_compress_len =
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1139  				be64_to_cpu(hv_nxc->min_compress_len);
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1140  		nx_cop_caps.min_decompress_len =
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1141  				be64_to_cpu(hv_nxc->min_decompress_len);
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1142  	} else {
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1143  		caps_feat = 0;
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1144  	}
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1145  
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17 @1146  	kfree(hv_nxc);
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1147  out:
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1148  	kfree(hv_caps);
b4ba22114c78de4 drivers/crypto/nx/nx-common-pseries.c Haren Myneni  2021-06-17  1149  }

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ