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/[email protected]/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 <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
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