[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202201250944.dyy7niOd-lkp@intel.com>
Date: Tue, 25 Jan 2022 10:35:31 +0800
From: kernel test robot <lkp@...el.com>
To: lostway@....edu.cn, linux-kernel@...r.kernel.org,
linux-edac@...r.kernel.org, bp@...en8.de, tony.luck@...el.com
Cc: kbuild-all@...ts.01.org
Subject: Re: [PATCH] RAS: Report ARM processor information to userspace
Hi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linux/master]
[also build test WARNING on rafael-pm/linux-next linus/master v5.17-rc1 next-20220124]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/lostway-zju-edu-cn/RAS-Report-ARM-processor-information-to-userspace/20220124-174203
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2c271fe77d52a0555161926c232cd5bc07178b39
config: x86_64-randconfig-m001-20220124 (https://download.01.org/0day-ci/archive/20220125/202201250944.dyy7niOd-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
smatch warnings:
drivers/ras/ras.c:51 log_arm_hw_error() warn: unsigned 'vsei_len' is never less than zero.
vim +/vsei_len +51 drivers/ras/ras.c
23
24 void log_arm_hw_error(struct cper_sec_proc_arm *err, const u8 sev)
25 {
26 u32 pei_len;
27 u32 ctx_len = 0;
28 u32 vsei_len;
29 u8 *pei_err;
30 u8 *ctx_err;
31 u8 *ven_err_data;
32 struct cper_arm_err_info *err_info;
33 struct cper_arm_ctx_info *ctx_info;
34 int n, sz;
35 int cpu;
36
37 pei_len = sizeof(struct cper_arm_err_info) * err->err_info_num;
38 pei_err = (u8 *)err + sizeof(struct cper_sec_proc_arm);
39
40 err_info = (struct cper_arm_err_info *)(err + 1);
41 ctx_info = (struct cper_arm_ctx_info *)(err_info + err->err_info_num);
42 ctx_err = (u8 *)ctx_info;
43 for (n = 0; n < err->context_info_num; n++) {
44 sz = sizeof(struct cper_arm_ctx_info) + ctx_info->size;
45 ctx_info = (struct cper_arm_ctx_info *)((long)ctx_info + sz);
46 ctx_len += sz;
47 }
48
49 vsei_len = err->section_length - (sizeof(struct cper_sec_proc_arm) +
50 pei_len + ctx_len);
> 51 if (vsei_len < 0) {
52 pr_warn(FW_BUG
53 "section length: %d\n", err->section_length);
54 pr_warn(FW_BUG
55 "section length is too small\n");
56 pr_warn(FW_BUG
57 "firmware-generated error record is incorrect\n");
58 vsei_len = 0;
59 }
60 ven_err_data = (u8 *)ctx_info;
61
62 cpu = GET_LOGICAL_INDEX(err->mpidr);
63 /* when return value is invalid, set cpu index to -1 */
64 if (cpu < 0)
65 cpu = -1;
66
67 trace_arm_event(err, pei_err, pei_len, ctx_err, ctx_len,
68 ven_err_data, vsei_len, sev, cpu);
69 }
70
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Powered by blists - more mailing lists