* [linux-next:master 602/1199] drivers/cpufreq/sun50i-cpufreq-nvmem.c:229:20: sparse: sparse: cast to restricted __le32
@ 2025-04-07 16:01 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-04-07 16:01 UTC (permalink / raw)
To: Andre Przywara; +Cc: oe-kbuild-all, Viresh Kumar, Jernej Škrabec
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 2bdde620f7f2bff2ff1cb7dc166859eaa0c78a7c
commit: 1efdea0517384d30316acdfb006c0650804dc2ff [602/1199] cpufreq: sun50i: prevent out-of-bounds access
config: riscv-randconfig-r111-20250407 (https://download.01.org/0day-ci/archive/20250407/202504072322.EwPvc4ch-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 92c93f5286b9ff33f27ff694d2dc33da1c07afdd)
reproduce: (https://download.01.org/0day-ci/archive/20250407/202504072322.EwPvc4ch-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504072322.EwPvc4ch-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
WARNING: invalid argument to '-march': '_zacas_zabha'
>> drivers/cpufreq/sun50i-cpufreq-nvmem.c:229:20: sparse: sparse: cast to restricted __le32
vim +229 drivers/cpufreq/sun50i-cpufreq-nvmem.c
184
185 /**
186 * sun50i_cpufreq_get_efuse() - Determine speed grade from efuse value
187 *
188 * Returns non-negative speed bin index on success, a negative error
189 * value otherwise.
190 */
191 static int sun50i_cpufreq_get_efuse(void)
192 {
193 const struct sunxi_cpufreq_data *opp_data;
194 struct nvmem_cell *speedbin_nvmem;
195 const struct of_device_id *match;
196 struct device *cpu_dev;
197 void *speedbin_ptr;
198 u32 speedbin = 0;
199 size_t len;
200 int ret;
201
202 cpu_dev = get_cpu_device(0);
203 if (!cpu_dev)
204 return -ENODEV;
205
206 struct device_node *np __free(device_node) =
207 dev_pm_opp_of_get_opp_desc_node(cpu_dev);
208 if (!np)
209 return -ENOENT;
210
211 match = of_match_node(cpu_opp_match_list, np);
212 if (!match)
213 return -ENOENT;
214
215 opp_data = match->data;
216
217 speedbin_nvmem = of_nvmem_cell_get(np, NULL);
218 if (IS_ERR(speedbin_nvmem))
219 return dev_err_probe(cpu_dev, PTR_ERR(speedbin_nvmem),
220 "Could not get nvmem cell\n");
221
222 speedbin_ptr = nvmem_cell_read(speedbin_nvmem, &len);
223 nvmem_cell_put(speedbin_nvmem);
224 if (IS_ERR(speedbin_ptr))
225 return PTR_ERR(speedbin_ptr);
226
227 if (len <= 4)
228 memcpy(&speedbin, speedbin_ptr, len);
> 229 speedbin = le32_to_cpu(speedbin);
230
231 ret = opp_data->efuse_xlate(speedbin);
232
233 kfree(speedbin_ptr);
234
235 return ret;
236 };
237
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-04-07 16:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-07 16:01 [linux-next:master 602/1199] drivers/cpufreq/sun50i-cpufreq-nvmem.c:229:20: sparse: sparse: cast to restricted __le32 kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.