From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [linux-next:master 12015/12944] drivers/firmware/arm_scmi/powercap.c:723 scmi_powercap_domain_init_fc() error: buffer overflow 'fc' 2 <= 6
Date: Sun, 10 Mar 2024 07:43:03 +0800 [thread overview]
Message-ID: <202403100744.7Op3PI8L-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Pierre Gondois <pierre.gondois@arm.com>
CC: Viresh Kumar <viresh.kumar@linaro.org>
CC: Cristian Marussi <cristian.marussi@arm.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 8ffc8b1bbd505e27e2c8439d326b6059c906c9dd
commit: 2441caa84aac8abf1be9e20db3e6bb921e74c8a2 [12015/12944] firmware: arm_scmi: Populate fast channel rate_limit
:::::: branch date: 2 days ago
:::::: commit date: 4 days ago
config: nios2-randconfig-r071-20240309 (https://download.01.org/0day-ci/archive/20240310/202403100744.7Op3PI8L-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 13.2.0
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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202403100744.7Op3PI8L-lkp@intel.com/
smatch warnings:
drivers/firmware/arm_scmi/powercap.c:723 scmi_powercap_domain_init_fc() error: buffer overflow 'fc' 2 <= 6
vim +/fc +723 drivers/firmware/arm_scmi/powercap.c
0316f99c4780b0 Cristian Marussi 2022-07-04 693
855aa26e5f56d4 Cristian Marussi 2022-07-04 694 static void scmi_powercap_domain_init_fc(const struct scmi_protocol_handle *ph,
855aa26e5f56d4 Cristian Marussi 2022-07-04 695 u32 domain, struct scmi_fc_info **p_fc)
855aa26e5f56d4 Cristian Marussi 2022-07-04 696 {
855aa26e5f56d4 Cristian Marussi 2022-07-04 697 struct scmi_fc_info *fc;
855aa26e5f56d4 Cristian Marussi 2022-07-04 698
855aa26e5f56d4 Cristian Marussi 2022-07-04 699 fc = devm_kcalloc(ph->dev, POWERCAP_FC_MAX, sizeof(*fc), GFP_KERNEL);
855aa26e5f56d4 Cristian Marussi 2022-07-04 700 if (!fc)
855aa26e5f56d4 Cristian Marussi 2022-07-04 701 return;
855aa26e5f56d4 Cristian Marussi 2022-07-04 702
855aa26e5f56d4 Cristian Marussi 2022-07-04 703 ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL,
855aa26e5f56d4 Cristian Marussi 2022-07-04 704 POWERCAP_CAP_SET, 4, domain,
855aa26e5f56d4 Cristian Marussi 2022-07-04 705 &fc[POWERCAP_FC_CAP].set_addr,
2441caa84aac8a Pierre Gondois 2024-02-22 706 &fc[POWERCAP_FC_CAP].set_db,
2441caa84aac8a Pierre Gondois 2024-02-22 707 &fc[POWERCAP_FC_CAP].rate_limit);
855aa26e5f56d4 Cristian Marussi 2022-07-04 708
855aa26e5f56d4 Cristian Marussi 2022-07-04 709 ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL,
855aa26e5f56d4 Cristian Marussi 2022-07-04 710 POWERCAP_CAP_GET, 4, domain,
2441caa84aac8a Pierre Gondois 2024-02-22 711 &fc[POWERCAP_FC_CAP].get_addr, NULL,
2441caa84aac8a Pierre Gondois 2024-02-22 712 &fc[POWERCAP_FC_CAP].rate_limit);
855aa26e5f56d4 Cristian Marussi 2022-07-04 713
855aa26e5f56d4 Cristian Marussi 2022-07-04 714 ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL,
855aa26e5f56d4 Cristian Marussi 2022-07-04 715 POWERCAP_PAI_SET, 4, domain,
855aa26e5f56d4 Cristian Marussi 2022-07-04 716 &fc[POWERCAP_FC_PAI].set_addr,
2441caa84aac8a Pierre Gondois 2024-02-22 717 &fc[POWERCAP_FC_PAI].set_db,
2441caa84aac8a Pierre Gondois 2024-02-22 718 &fc[POWERCAP_FC_PAI].rate_limit);
855aa26e5f56d4 Cristian Marussi 2022-07-04 719
855aa26e5f56d4 Cristian Marussi 2022-07-04 720 ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL,
855aa26e5f56d4 Cristian Marussi 2022-07-04 721 POWERCAP_PAI_GET, 4, domain,
2441caa84aac8a Pierre Gondois 2024-02-22 722 &fc[POWERCAP_FC_PAI].get_addr, NULL,
2441caa84aac8a Pierre Gondois 2024-02-22 @723 &fc[POWERCAP_PAI_GET].rate_limit);
855aa26e5f56d4 Cristian Marussi 2022-07-04 724
855aa26e5f56d4 Cristian Marussi 2022-07-04 725 *p_fc = fc;
855aa26e5f56d4 Cristian Marussi 2022-07-04 726 }
855aa26e5f56d4 Cristian Marussi 2022-07-04 727
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2024-03-09 23:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-09 23:43 kernel test robot [this message]
2024-03-11 5:26 [linux-next:master 12015/12944] drivers/firmware/arm_scmi/powercap.c:723 scmi_powercap_domain_init_fc() error: buffer overflow 'fc' 2 <= 6 Dan Carpenter
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=202403100744.7Op3PI8L-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/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 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.