mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: lostway@zju.edu.cn, linux-kernel@vger.kernel.org,
	linux-edac@vger.kernel.org, bp@alien8.de, tony.luck@intel.com
Cc: kbuild-all@lists.01.org
Subject: Re: [PATCH] RAS: Report ARM processor information to userspace
Date: Tue, 25 Jan 2022 10:35:31 +0800	[thread overview]
Message-ID: <202201250944.dyy7niOd-lkp@intel.com> (raw)
In-Reply-To: <20220124093034.33095-1-lostway@zju.edu.cn>

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@intel.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

      reply	other threads:[~2022-01-25  3:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24  9:30 lostway
2022-01-25  2:35 ` kernel test robot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202201250944.dyy7niOd-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=bp@alien8.de \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lostway@zju.edu.cn \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome